Update app.py
Browse files
app.py
CHANGED
@@ -18,7 +18,7 @@ model = AutoModelForCausalLM.from_pretrained(model_name)
|
|
18 |
def ask_medical_question(question):
|
19 |
prompt = f"<|start_header_id|>system<|end_header_id|> You are a Medical AI chatbot assistant. <|eot_id|><|start_header_id|>User: <|end_header_id|>This is the question: {question}<|eot_id|>"
|
20 |
|
21 |
-
inputs = tokenizer(prompt, return_tensors="pt").to(
|
22 |
outputs = model.generate(
|
23 |
**inputs,
|
24 |
max_new_tokens=256,
|
|
|
18 |
def ask_medical_question(question):
|
19 |
prompt = f"<|start_header_id|>system<|end_header_id|> You are a Medical AI chatbot assistant. <|eot_id|><|start_header_id|>User: <|end_header_id|>This is the question: {question}<|eot_id|>"
|
20 |
|
21 |
+
inputs = tokenizer(prompt, return_tensors="pt").to(device)
|
22 |
outputs = model.generate(
|
23 |
**inputs,
|
24 |
max_new_tokens=256,
|