ritvik77 commited on
Commit
032f308
·
verified ·
1 Parent(s): c4c2f82

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +12 -1
README.md CHANGED
@@ -49,7 +49,18 @@ This modelcard aims to be a base template for new models. It has been generated
49
 
50
  ## Uses
51
 
52
- <!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
 
 
 
 
 
 
 
 
 
 
 
53
 
54
  ### Direct Use
55
 
 
49
 
50
  ## Uses
51
 
52
+ from transformers import AutoModelForCausalLM, AutoTokenizer
53
+
54
+ # ✅ Load the uploaded model
55
+ model = AutoModelForCausalLM.from_pretrained("ritvik77/Medical_Doctor_AI_LoRA-Mistral-7B-Instruct")
56
+ tokenizer = AutoTokenizer.from_pretrained("ritvik77/Medical_Doctor_AI_LoRA-Mistral-7B-Instruct")
57
+
58
+ # ✅ Sample inference
59
+ prompt = "Patient reports chest pain and dizziness. What’s the likely diagnosis?"
60
+ inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
61
+
62
+ outputs = model.generate(**inputs, max_new_tokens=300)
63
+ print(tokenizer.decode(outputs[0], skip_special_tokens=True))
64
 
65
  ### Direct Use
66