lukaskim commited on
Commit
d7cd500
·
verified ·
1 Parent(s): 5d448db

Initial upload

Browse files
README.md ADDED
@@ -0,0 +1,124 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: mit
3
+ task_categories:
4
+ - text-generation
5
+ tags:
6
+ - chemistry
7
+ - drug-discovery
8
+ - smiles
9
+ - molecules
10
+ - instruction-tuning
11
+ size_categories:
12
+ - 1M<n<10M
13
+ configs:
14
+ - config_name: all
15
+ data_files: all/*.parquet
16
+ default: true
17
+ - config_name: smileyllama
18
+ data_files: smileyllama/*.parquet
19
+ - config_name: linkllama
20
+ data_files: linkllama/*.parquet
21
+ dataset_info:
22
+ features:
23
+ - name: instruction
24
+ dtype: string
25
+ - name: input
26
+ dtype: string
27
+ - name: output
28
+ dtype: string
29
+ - name: source
30
+ dtype: string
31
+ ---
32
+
33
+ # CADD-Instruct
34
+
35
+ An instruction-tuning dataset for computer-aided drug design (CADD).
36
+
37
+ ## Format
38
+
39
+ Every row follows the standard instruction / input / output schema:
40
+
41
+ | field | description |
42
+ | --- | --- |
43
+ | `instruction` | The system-level role/task description. |
44
+ | `input` | The user request, listing the target molecular properties. |
45
+ | `output` | A SMILES string satisfying the request. |
46
+ | `source` | Origin of the row (`smileyllama` or `linkllama`). |
47
+
48
+ ### Example
49
+
50
+ ```json
51
+ {
52
+ "instruction": "You love and excel at generating SMILES strings of drug-like molecules",
53
+ "input": "Output a SMILES string for a drug-like molecule with the following properties: <= 90 TPSA, lacks bad SMARTS, has covalent warheads (acrylamides), <= 5 LogP, <= 0.4 Fraction sp3, <= 10 Rotatable bonds:",
54
+ "output": "n1cc(/C=C/C(=O)Nc2ccc(cc2)COC)c(cc1)-c1cnn(C)c1",
55
+ "source": "smileyllama"
56
+ }
57
+ ```
58
+
59
+ ## Configurations
60
+
61
+ | config | rows | description |
62
+ | --- | --- | --- |
63
+ | `all` (default) | ~3.86M | Combined dataset (all sources). |
64
+ | `smileyllama` | ~2.33M | SmileyLlama SFT data. |
65
+ | `linkllama` | ~1.53M | LinkLlama cap50 training data. |
66
+
67
+ ## Usage
68
+
69
+ Load the full dataset:
70
+
71
+ ```python
72
+ from datasets import load_dataset
73
+
74
+ ds = load_dataset("cadd-instruct") # default "all" config
75
+ print(ds["train"][0])
76
+ ```
77
+
78
+ Filter the combined dataset by `source`:
79
+
80
+ ```python
81
+ from datasets import load_dataset
82
+
83
+ ds = load_dataset("cadd-instruct", split="train")
84
+ smiley = ds.filter(lambda ex: ex["source"] == "smileyllama")
85
+ ```
86
+
87
+ Or load a specific source directly:
88
+
89
+ ```python
90
+ from datasets import load_dataset
91
+
92
+ smiley = load_dataset("cadd-instruct", "smileyllama")
93
+ link = load_dataset("cadd-instruct", "linkllama")
94
+ ```
95
+
96
+ Stream instead of downloading everything up front:
97
+
98
+ ```python
99
+ from datasets import load_dataset
100
+
101
+ ds = load_dataset("cadd-instruct", split="train", streaming=True)
102
+ for example in ds:
103
+ print(example["input"], "->", example["output"])
104
+ break
105
+ ```
106
+
107
+ Format a row into a prompt for supervised fine-tuning:
108
+
109
+ ```python
110
+ from datasets import load_dataset
111
+
112
+ ds = load_dataset("cadd-instruct", split="train")
113
+
114
+ def to_prompt(ex):
115
+ return {"text": f"{ex['instruction']}\n\n{ex['input']}\n{ex['output']}"}
116
+
117
+ ds = ds.map(to_prompt)
118
+ print(ds[0]["text"])
119
+ ```
120
+
121
+ ## Sources
122
+
123
+ - **smileyllama**: SFT data for SmileyLlama — https://figshare.com/articles/dataset/SFT_Data_for_SmileyLlama/30854573
124
+ - **linkllama**: https://huggingface.co/datasets/THGLab/LinkLlama-cap50-train
all/train-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8ab731616a4a6f9084260b180c3668b04c5e512b7a6fa97df8bc7f8b95c1339c
3
+ size 305431882
linkllama/train-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5c12244729a62b3dce0b1f52e3a95470e6a998a9ddc5f02bf4ec0b26d3d1ed8a
3
+ size 136829760
smileyllama/train-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e93399c684d4f13fccb7bf4c6b5aa89c87c7be7921489ef2007efd03c13d9ba9
3
+ size 168228366