Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -19,7 +19,7 @@ model = AutoModelForCausalLM.from_pretrained(model_name).to(device)
|
|
| 19 |
tokenizer = AutoTokenizer.from_pretrained(model_name, trust_remote_code=True)
|
| 20 |
tokenizer.pad_token = tokenizer.eos_token
|
| 21 |
@spaces.GPU
|
| 22 |
-
def askme(
|
| 23 |
sys_message = '''\
|
| 24 |
You are an AI Medical Assistant trained on a vast dataset of health information. Please be thorough and
|
| 25 |
provide an informative answer. If you don't know the answer to a specific medical inquiry, advise seeking professional help.
|
|
@@ -44,10 +44,10 @@ question = '''\
|
|
| 44 |
Could these symptoms be related to hypothyroidism?
|
| 45 |
If so, what steps should I take to get a proper diagnosis and discuss treatment options?
|
| 46 |
'''
|
| 47 |
-
examples = [ {"
|
| 48 |
iface = gr.Interface(
|
| 49 |
fn=askme,
|
| 50 |
-
inputs=["
|
| 51 |
outputs="text",
|
| 52 |
examples = examples,
|
| 53 |
title="Medical AI Chatbot",
|
|
|
|
| 19 |
tokenizer = AutoTokenizer.from_pretrained(model_name, trust_remote_code=True)
|
| 20 |
tokenizer.pad_token = tokenizer.eos_token
|
| 21 |
@spaces.GPU
|
| 22 |
+
def askme(symptoms, question):
|
| 23 |
sys_message = '''\
|
| 24 |
You are an AI Medical Assistant trained on a vast dataset of health information. Please be thorough and
|
| 25 |
provide an informative answer. If you don't know the answer to a specific medical inquiry, advise seeking professional help.
|
|
|
|
| 44 |
Could these symptoms be related to hypothyroidism?
|
| 45 |
If so, what steps should I take to get a proper diagnosis and discuss treatment options?
|
| 46 |
'''
|
| 47 |
+
examples = [ {"symptoms": symptoms, "question": question}]
|
| 48 |
iface = gr.Interface(
|
| 49 |
fn=askme,
|
| 50 |
+
inputs=["symptoms", "question"],
|
| 51 |
outputs="text",
|
| 52 |
examples = examples,
|
| 53 |
title="Medical AI Chatbot",
|