This is a fine-tuned version of Llama-2-7b-chat, adapted for predicting drug names based on chemical properties. Given parameters like InChI, SMILES, HBD, and logP, this model generates probable drug names.
Users should verify predictions with domain experts and use this model as a supplementary tool rather than a definitive source.
1from transformers import LlamaTokenizer, LlamaForCausalLM
2
3# Load model and tokenizer
4model_name = "webs911/Llama-2-7b-chat-smile-finetune"
5tokenizer = LlamaTokenizer.from_pretrained(model_name)
6model = LlamaForCausalLM.from_pretrained(model_name)
7
8def predict_drug_name(prompt):
9 inputs = tokenizer(prompt, return_tensors="pt")
10 outputs = model.generate(**inputs, max_new_tokens=200)
11 return tokenizer.decode(outputs[0], skip_special_tokens=True)
12
13# Example usage
14prompt = "Predict the drug name given the following parameters:\nInChI: ...\nSMILES: ...\nHBD: ...\nlogP: ..."
15print(predict_drug_name(prompt))