jonghyunlee commited on
Commit
e628885
·
verified ·
1 Parent(s): b57d098

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +60 -3
README.md CHANGED
@@ -1,3 +1,60 @@
1
- ---
2
- license: mit
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: mit
3
+ datasets:
4
+ - jonghyunlee/ZINC15
5
+ ---
6
+
7
+ # 🧪 Mol-GPT2; long context, pretrained with ZINC-15
8
+
9
+ This repository hosts a GPT-2-based model for generating SMILES strings, trained on the ZINC 15 dataset. The model follows the architecture and hyperparameter setup of MolGPT (Bagal et al., 2021), and has been fine-tuned to generate valid molecular representations with high accuracy.
10
+ This model has longer context length (256), whereas the previous model has maximum context lenght 128.
11
+
12
+ ---
13
+
14
+ ## 🔧 Model Architecture
15
+
16
+ GPT2Config(
17
+ vocab_size=10_000,
18
+ n_positions=256,
19
+ n_ctx=256,
20
+ n_embd=256,
21
+ n_layer=8,
22
+ n_head=8,
23
+ resid_pdrop=0.1,
24
+ embd_pdrop=0.1,
25
+ attn_pdrop=0.1,
26
+ )
27
+
28
+ - Pretrained with fp16 precision on 2× H100 GPUs
29
+ - Batch size: 1,024
30
+ - Max steps: 100,000
31
+ - Warmup steps: 10,000
32
+ - Evaluation every 10,000 steps
33
+
34
+ ---
35
+
36
+ ## 📊 Performance
37
+
38
+ | Dataset/Metric | This Model | Short Context | MolGPT Baseline |
39
+ |----------------------|------------|---------------|-----------------|
40
+ | ZINC15 Validity | 99.76% | 99.68% | N/A |
41
+ | MOSES Validity | N/A | N/A | 99.4% |
42
+ | GuacaMol Validity | N/A | N/A | 98.1% |
43
+
44
+ ---
45
+
46
+ ## 🚀 Usage Example
47
+
48
+ ```
49
+ from transformers import AutoTokenizer, AutoModelForCausalLM
50
+
51
+ # Load tokenizer and model
52
+ tokenizer = AutoTokenizer.from_pretrained("your-username/smiles-tokenizer")
53
+ model = AutoModelForCausalLM.from_pretrained("your-username/molgpt-lite")
54
+
55
+ # Generate molecules
56
+ input_ids = tokenizer("CC(=O)OC1=CC=CC=C1C(=O)O", return_tensors="pt").input_ids
57
+ outputs = model.generate(input_ids, max_length=256, do_sample=True, top_k=50)
58
+
59
+ print(tokenizer.decode(outputs[0], skip_special_tokens=True))
60
+ ```