Tonic commited on
Commit
a3eaa33
โ€ข
1 Parent(s): 6bd2103

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
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"<s>[INST]{system_prompt} {user_input}[/INST]"
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"<s>[INST]{system_prompt} {user_input}[/INST]"
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 = "๐Ÿ‘‹๐Ÿปํ† ๋‹‰์˜ ๋ฏธ์ŠคํŠธ๋ž„๋ฉ”๋“œ ์ฑ„ํŒ…์— ์˜ค์‹  ๊ฒƒ์„ ํ™˜์˜ํ•ฉ๋‹ˆ๋‹ค๐Ÿš€๐Ÿ‘‹๐ŸปWelcome to Tonic's MistralMed Chat๐Ÿš€"
106
- description = "์ด ๊ณต๊ฐ„์„ ์‚ฌ์šฉํ•˜์—ฌ ํ˜„์žฌ ๋ชจ๋ธ์„ ํ…Œ์ŠคํŠธํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. [(Tonic/MistralMed)](https://huggingface.co/Tonic/MistralMed) ๋˜๋Š” ์ด ๊ณต๊ฐ„์„ ๋ณต์ œํ•˜๊ณ  ๋กœ์ปฌ ๋˜๋Š” ๐Ÿค—HuggingFace์—์„œ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. [Discord์—์„œ ํ•จ๊ป˜ ๋งŒ๋“ค๊ธฐ ์œ„ํ•ด Discord์— ๊ฐ€์ž…ํ•˜์‹ญ์‹œ์˜ค](https://discord.gg/VqTxc76K3u). You can use this Space to test out the current model [(Tonic/MistralMed)](https://huggingface.co/Tonic/MistralMed) or duplicate this Space and use it locally or on ๐Ÿค—HuggingFace. [Join me on Discord to build together](https://discord.gg/VqTxc76K3u)."
107
- examples = [["[Question:] 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,
 
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,