Downloads · 30 days
9
5% of all-time downloads
rhoahndur/retrosynthesis-qwen3-4b
retrosynthesis-qwen3-4b is a text generation model from rhoahndur. Use it when you need the model to write or continue text. The card lists the license as apache-2.0.
Qwen3-4B fine-tuned for retrosynthetic route prediction via GRPO on Prime Intellect.
Downloads · 30 days
9
5% of all-time downloads
All-time downloads
176
Public
Parameters
4B
8.2 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors8.2 GB · 100%
From the Hugging Face model README
Qwen3-4B fine-tuned for retrosynthetic route prediction via GRPO on Prime Intellect.
Given a target molecule SMILES, predicts reactant molecules that can synthesize it.
Training: GRPO with 6-component RDKit reward rubric (validity, SA score, stock match, atom conservation) Dataset: USPTO-50K via rhoahndur/retrosyn-targets
from transformers import AutoModelForCausalLM, AutoTokenizer
model = AutoModelForCausalLM.from_pretrained("rhoahndur/retrosynthesis-qwen3-4b")
tokenizer = AutoTokenizer.from_pretrained("rhoahndur/retrosynthesis-qwen3-4b")
messages = [
{"role": "system", "content": "You are a retrosynthesis expert. Given a target molecule SMILES, predict reactant SMILES separated by dots. Output ONLY SMILES, no explanation."},
{"role": "user", "content": "Predict the reactants for: CC(=O)Oc1ccccc1C(=O)O"}
]
text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer(text, return_tensors="pt")
outputs = model.generate(**inputs, max_new_tokens=128, temperature=0.7, do_sample=True)
print(tokenizer.decode(outputs[0][inputs.input_ids.shape[1]:], skip_special_tokens=True))