Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -22,7 +22,7 @@ def multimodal_prompt(user_input, system_prompt="You are an expert medical analy
|
|
22 |
A string containing the generated text.
|
23 |
"""
|
24 |
# Combine user input and system prompt
|
25 |
-
formatted_input = f"
|
26 |
|
27 |
# Encode the input text
|
28 |
encodeds = tokenizer(formatted_input, return_tensors="pt", add_special_tokens=False)
|
@@ -87,7 +87,7 @@ class ChatBot:
|
|
87 |
|
88 |
def predict(self, user_input, system_prompt="You are an expert medical analyst:"):
|
89 |
# Combine the user's input with the system prompt
|
90 |
-
formatted_input = f"
|
91 |
|
92 |
# Encode the formatted input using the tokenizer
|
93 |
user_input_ids = tokenizer.encode(formatted_input, return_tensors="pt")
|
@@ -102,9 +102,9 @@ class ChatBot:
|
|
102 |
|
103 |
bot = ChatBot()
|
104 |
|
105 |
-
title = "
|
106 |
-
description = "
|
107 |
-
examples = [["
|
108 |
|
109 |
iface = gr.Interface(
|
110 |
fn=bot.predict,
|
|
|
22 |
A string containing the generated text.
|
23 |
"""
|
24 |
# Combine user input and system prompt
|
25 |
+
formatted_input = f"Question: {system_prompt} {user_input} \n Mini :"
|
26 |
|
27 |
# Encode the input text
|
28 |
encodeds = tokenizer(formatted_input, return_tensors="pt", add_special_tokens=False)
|
|
|
87 |
|
88 |
def predict(self, user_input, system_prompt="You are an expert medical analyst:"):
|
89 |
# Combine the user's input with the system prompt
|
90 |
+
formatted_input = f"Question: {system_prompt} {user_input} Mini:"
|
91 |
|
92 |
# Encode the formatted input using the tokenizer
|
93 |
user_input_ids = tokenizer.encode(formatted_input, return_tensors="pt")
|
|
|
102 |
|
103 |
bot = ChatBot()
|
104 |
|
105 |
+
title = "๐๐ปWelcome to Tonic's GaiaMiniMed Chat๐"
|
106 |
+
description = "You can use this Space to test out the current model [(Tonic/GaiaMiniMed)](https://huggingface.co/Tonic/GaiaMiniMed) or duplicate this Space and use it locally or on ๐คHuggingFace. [Join me on Discord to build together](https://discord.gg/VqTxc76K3u)."
|
107 |
+
examples = [["What is the proper treatment for buccal herpes?", "You are a medicine and public health expert, you will receive a question, answer the question, and provide a complete answer"]]
|
108 |
|
109 |
iface = gr.Interface(
|
110 |
fn=bot.predict,
|