File size: 4,487 Bytes
0031c67
 
 
 
 
 
 
 
 
 
 
 
 
 
bb6e60f
a4a5f7f
 
0031c67
 
 
 
 
 
 
 
a4a5f7f
0031c67
 
 
 
 
 
 
a4a5f7f
0031c67
 
 
 
 
 
 
bb6e60f
 
0031c67
 
55b4e84
0031c67
 
 
a4a5f7f
 
0031c67
bb6e60f
935f8f3
 
 
bb6e60f
0031c67
 
 
bb6e60f
935f8f3
 
 
 
 
0031c67
 
 
 
 
 
a4a5f7f
 
bb6e60f
a4a5f7f
 
0031c67
a4a5f7f
0031c67
a4a5f7f
0031c67
a4a5f7f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
---
license: mit
language:
- en
tags:
- chemistry
- medical
---
# Model Card for Model ID


This modelcard aims to be a base template for new models. It has been generated using [this raw template](https://github.com/huggingface/huggingface_hub/blob/main/src/huggingface_hub/templates/modelcard_template.md?plain=1).

## Model Details
Chemfuser is a prototype base model that explores the use of diffusion-inspired transformers for SMILES sequence completion. It represents an early proof-of-concept for unmasking partial chemical structures using learned context and token diffusion.

This is the first in a planned series of models aimed at general-purpose molecular generation, inpainting, and drug design. Work is actively ongoing to expand its capabilities, integrate richer chemical priors, and train larger and more expressive versions for broader applicability across medicinal chemistry, cheminformatics, and materials science.

### Model Description

<!-- Provide a longer summary of what this model is. -->



- **Developed by:** [@kelu01](https://huggingface.co/kelu01)
- **Shared by:** [@kelu01](https://huggingface.co/kelu01) (mdkcharles@gmail.com)]
- **Model type:** Diffusion-based Transformer for SMILES token unmasking
- **Language(s):** English (for logs/prints), SMILES strings (chemical tokens)
- **License:** MIT
- **Finetuned from:** Custom architecture (not a pretrained NLP base model)
- **Framework:** PyTorch


## Usage

You can use this model directly via the Hugging Face `pipeline`:

```python
from transformers import AutoTokenizer, pipeline

# Load tokenizer and pipeline
tokenizer = AutoTokenizer.from_pretrained("kelu01/Chemfuser")
pipe = pipeline("smiles-diffusion", model="kelu01/Chemfuser", voc=tokenizer, trust_remote_code=True)

# Provide a partially masked SMILES string
masked_smiles = "CC[MASK]N[MASK]1[MASK][MASK]C[MASK][C@H][MASK][MASK][MASK][MASK][MASK][MASK])c[MASK][MASK]c[MASK]c[MASK][MASK]C([MASK][MASK]([MASK])[MASK])c[MASK]cc[MASK]c2[MASK]cc[MASK]c[MASK]2"  # Example
completed = pipe(masked_smiles)
print(completed)

```
## Out-of-Scope Use

Chemfuser is not intended for the following:
- Natural language tasks such as text generation, sentiment analysis, or question answering.
- Direct clinical decision-making or drug safety evaluation. The model is research-grade and should not be used in medical settings without further validation.
- Arbitrary string generation — input must be a partially masked SMILES string with valid chemical syntax.
- Structure validation or property prediction — Chemfuser does not verify chemical correctness or predict bioactivity; external tools (e.g., RDKit) must be used for validation.

## Bias, Risks, and Limitations

While Chemfuser is powerful for generating chemically plausible molecules, it comes with the following limitations:
- Chemical Validity Not Guaranteed: The model can produce syntactically correct but chemically invalid molecules. Use cheminformatics tools like RDKit to filter outputs.
- Biological Activity Unknown: The generated molecules are not guaranteed to be biologically active or safe. Experimental validation is essential.
- Bias in Training Data: The model is trained on publicly available databases (e.g., ZINC, ChEMBL), which are biased toward drug-like, small organic molecules. It may perform poorly on polymers, organometallics, or exotic chemical spaces.
- Token Limitation: SMILES strings that are too long may be truncated or produce poor results.
- Data Leakage Risk: Since pretraining involves known compounds, generated molecules might occasionally resemble known entities from training data.


## How to Get Started with the Model

Use the code below to get started with the model.

```python
from transformers import AutoModel
model = AutoModel.from_pretrained("kelu01/Chemfuser",trust_remote_code=True)
```
## Disclaimer

This model is provided as-is for research and educational purposes only. While care has been taken in its development, the author makes no warranties or guarantees regarding its performance, correctness, or fitness for any particular purpose.

The author shall not be held liable for any damages, losses, or legal issues that may arise from the use or misuse of this model, including but not limited to applications in drug development, clinical decision-making, or the generation of harmful substances. 

Users are solely responsible for validating and verifying the outputs using appropriate scientific and safety protocols.