--- license: mit task_categories: - text-generation tags: - chemistry - drug-discovery - smiles - molecules - instruction-tuning - retrosynthesis - synthesis-planning size_categories: - 1M= 1 rotatable bonds, >= 5 heavy atoms to connect them. The final molecule should be unreasonable. And it should have the following properties: <= 5H-bond donors, <= 7 H-bond acceptors, <= 600 Molecular weight, <= 200 TPSA.", "output": "{\"linker\": \"BrC(=C\\\\[*:2])/C=N/N[*:1]\", \"reasoning\": \"Linker bad rings: pass. Linker problematic ring: absent. Undesirable SMARTS: pass. PAINS: pass. REOS failed rule: imine.\"}", "source": "linkllama" } ``` Synthesis planning (`synllama`): ```json { "instruction": "You are an expert synthetic organic chemist. Your task is to design a synthesis pathway for a given target molecule using common and reliable reaction templates and building blocks. ...", "input": "Provide a synthetic pathway for this SMILES string: CNC1(CC(=O)[C@]2(...))CCCCC1", "output": "{\"reactions\": [{\"reaction_number\": 1, \"reaction_template\": \"...\", \"reactants\": [...]}]}", "source": "synllama" } ``` ## Configurations | config | rows | description | | --- | --- | --- | | `all` (default) | ~5.86M | Combined dataset (all sources). | | `smileyllama` | ~2.33M | SmileyLlama SFT data (conditional generation). | | `linkllama` | ~1.53M | LinkLlama cap50 training data (conditional generation). | | `synllama` | 2.00M | SynLlama synthesis-pathway data (synthesis planning). | ## Usage Load the full dataset: ```python from datasets import load_dataset ds = load_dataset("lukaskim/cadd-instruct") # default "all" config print(ds["train"][0]) ``` Filter the combined dataset by `source`: ```python from datasets import load_dataset ds = load_dataset("lukaskim/cadd-instruct", split="train") smiley = ds.filter(lambda ex: ex["source"] == "smileyllama") ``` Or load a specific source directly: ```python from datasets import load_dataset smiley = load_dataset("lukaskim/cadd-instruct", "smileyllama") link = load_dataset("lukaskim/cadd-instruct", "linkllama") ``` Stream instead of downloading everything up front: ```python from datasets import load_dataset ds = load_dataset("lukaskim/cadd-instruct", split="train", streaming=True) for example in ds: print(example["input"], "->", example["output"]) break ``` Format a row into a prompt for supervised fine-tuning: ```python from datasets import load_dataset ds = load_dataset("lukaskim/cadd-instruct", split="train") def to_prompt(ex): return {"text": f"{ex['instruction']}\n\n{ex['input']}\n{ex['output']}"} ds = ds.map(to_prompt) print(ds[0]["text"]) ``` ## Sources - **smileyllama**: SFT data for SmileyLlama — https://figshare.com/articles/dataset/SFT_Data_for_SmileyLlama/30854573 - **linkllama**: https://huggingface.co/datasets/THGLab/LinkLlama-cap50-train - **synllama**: https://github.com/THGLab/SynLlama/tree/main