InferenceLab commited on
Commit
d7233c5
·
verified ·
1 Parent(s): f1a1318

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +20 -8
README.md CHANGED
@@ -62,15 +62,27 @@ Users should validate outputs with certified medical professionals. This model i
62
  ## How to Get Started with the Model
63
 
64
  ```python
65
- from transformers import AutoModelForCausalLM, AutoTokenizer
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
66
 
67
- model = AutoModelForCausalLM.from_pretrained("InferenceLab/MediLlama-3.2")
68
- tokenizer = AutoTokenizer.from_pretrained("InferenceLab/MediLlama-3.2")
69
-
70
- input_text = "What are the symptoms of diabetes?"
71
- inputs = tokenizer(input_text, return_tensors="pt")
72
- outputs = model.generate(**inputs)
73
- print(tokenizer.decode(outputs[0]))
74
  ````
75
 
76
  ## Training Details
 
62
  ## How to Get Started with the Model
63
 
64
  ```python
65
+ import torch
66
+ from transformers import pipeline
67
+
68
+ model_id = "InferenceLab/MediLlama-3.2"
69
+ pipe = pipeline(
70
+ "text-generation",
71
+ model=model_id,
72
+ torch_dtype=torch.bfloat16,
73
+ device_map="auto",
74
+ )
75
+
76
+ messages = [
77
+ {"role": "system", "content": "You are a helpful Medical assistant."},
78
+ {"role": "user", "content": "Hi! How are you?"},
79
+ ]
80
+ outputs = pipe(
81
+ messages,
82
+ max_new_tokens=256,
83
+ )
84
+ print(outputs[0]["generated_text"][-1])
85
 
 
 
 
 
 
 
 
86
  ````
87
 
88
  ## Training Details