This model is a
full-parameter fine-tuned version of
HuggingFaceTB/SmolLM-135M trained on chemistry
SMILES strings from the
Codemaster67/Causal_lm_chemistry_1M_rows dataset.
The base model's tokenizer was pre-extended with ~300 SPE (SMILES Pair
Encoding) chemistry tokens plus <|start_of_smiles|> / <|end_of_smiles|>
special tokens, and its embedding & LM-head layers were resized with
mean-initialised vectors for the new tokens.
1from transformers import AutoModelForCausalLM, AutoTokenizer
2
3model = AutoModelForCausalLM.from_pretrained("Codemaster67/Test_run", trust_remote_code=True)
4tokenizer = AutoTokenizer.from_pretrained("Codemaster67/Test_run", trust_remote_code=True)
5
6smiles_input = "<|start_of_smiles|>CC(=O)Oc1ccccc1C(=O)O<|end_of_smiles|>"
7inputs = tokenizer(smiles_input, return_tensors="pt")
8outputs = model.generate(**inputs, max_new_tokens=128)
9print(tokenizer.decode(outputs[0], skip_special_tokens=False))
Chemistry-domain language modelling, SMILES generation and completion,
and downstream molecular property prediction via fine-tuning.