Commit ·
1f8ce9a
1
Parent(s): cd8148a
Update app.py
Browse files
app.py
CHANGED
|
@@ -71,15 +71,6 @@ class GaiaMinimed(ChatbotInterface):
|
|
| 71 |
|
| 72 |
return "", self.chat_history
|
| 73 |
|
| 74 |
-
class FalconBot(ChatbotInterface):
|
| 75 |
-
def __init__(self, name, system_prompt="You are an expert medical analyst that helps users with any medical related information."):
|
| 76 |
-
super().__init__(name, system_prompt)
|
| 77 |
-
|
| 78 |
-
def respond(self, msg, chatbot):
|
| 79 |
-
falcon_response = falcon_inference(msg)
|
| 80 |
-
falcon_output = falcon_response[0]["generated_text"]
|
| 81 |
-
self.chat_history.append([msg, falcon_output])
|
| 82 |
-
return "", falcon_output
|
| 83 |
|
| 84 |
class MistralBot(ChatbotInterface):
|
| 85 |
def __init__(self, name, system_prompt="You are an expert medical analyst that helps users with any medical related information."):
|
|
@@ -112,9 +103,9 @@ if __name__ == "__main__":
|
|
| 112 |
with gr.Row() as intro:
|
| 113 |
gr.Markdown(
|
| 114 |
"""
|
| 115 |
-
#
|
| 116 |
|
| 117 |
-
Welcome to
|
| 118 |
|
| 119 |
Dive into a world of medical expertise where you can interact with three specialized chatbots, all trained on the latest and most comprehensive medical dataset. Whether you have health-related questions, need medical advice, or just want to learn more about your well-being, MedChat is here to help!
|
| 120 |
|
|
@@ -134,8 +125,6 @@ if __name__ == "__main__":
|
|
| 134 |
with gr.Column() as col2:
|
| 135 |
with gr.Tab("MistralMed") as mistral:
|
| 136 |
mistral_bot = MistralBot("MistralMed")
|
| 137 |
-
with gr.Tab("Falcon-7B") as falcon7b:
|
| 138 |
-
falcon_bot = FalconBot("Falcon-7B")
|
| 139 |
|
| 140 |
gaia_bot.msg.input(fn=lambda s: (s[::1], s[::1]), inputs=gaia_bot.msg, outputs=[mistral_bot.msg, falcon_bot.msg])
|
| 141 |
mistral_bot.msg.input(fn=lambda s: (s[::1], s[::1]), inputs=mistral_bot.msg, outputs=[gaia_bot.msg, falcon_bot.msg])
|
|
|
|
| 71 |
|
| 72 |
return "", self.chat_history
|
| 73 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 74 |
|
| 75 |
class MistralBot(ChatbotInterface):
|
| 76 |
def __init__(self, name, system_prompt="You are an expert medical analyst that helps users with any medical related information."):
|
|
|
|
| 103 |
with gr.Row() as intro:
|
| 104 |
gr.Markdown(
|
| 105 |
"""
|
| 106 |
+
# Reliable Open Science Institutional Educator (R.O.S.I.E.)-OHSU Orthopaedics Edition
|
| 107 |
|
| 108 |
+
Welcome to Rosie, your friendly medical assistant chatbot! 🩺
|
| 109 |
|
| 110 |
Dive into a world of medical expertise where you can interact with three specialized chatbots, all trained on the latest and most comprehensive medical dataset. Whether you have health-related questions, need medical advice, or just want to learn more about your well-being, MedChat is here to help!
|
| 111 |
|
|
|
|
| 125 |
with gr.Column() as col2:
|
| 126 |
with gr.Tab("MistralMed") as mistral:
|
| 127 |
mistral_bot = MistralBot("MistralMed")
|
|
|
|
|
|
|
| 128 |
|
| 129 |
gaia_bot.msg.input(fn=lambda s: (s[::1], s[::1]), inputs=gaia_bot.msg, outputs=[mistral_bot.msg, falcon_bot.msg])
|
| 130 |
mistral_bot.msg.input(fn=lambda s: (s[::1], s[::1]), inputs=mistral_bot.msg, outputs=[gaia_bot.msg, falcon_bot.msg])
|