Spaces:
Runtime error
Runtime error
cleanup for the code
Browse files
app.py
CHANGED
@@ -261,16 +261,6 @@ def process_and_query(text=None):
|
|
261 |
try:
|
262 |
# augment the prompt before feeding it to vectara
|
263 |
text = "the user asks the following to his health adviser " + text
|
264 |
-
# If an image is provided, process it with OpenAI and use the response as the text query for Vectara
|
265 |
-
# if image is not None:
|
266 |
-
# text = process_image(image)
|
267 |
-
# return "**Summary:** "+text
|
268 |
-
# if audio is not None:
|
269 |
-
# text = process_speech(audio)
|
270 |
-
# # augment the prompt before feeding it to vectara
|
271 |
-
# text = "the user asks the following to his health adviser " + text
|
272 |
-
|
273 |
-
|
274 |
|
275 |
# Use the text to query Vectara
|
276 |
vectara_response_json = query_vectara(text)
|
@@ -299,37 +289,6 @@ def process_and_query(text=None):
|
|
299 |
return str(e)
|
300 |
|
301 |
|
302 |
-
# Define the Gradio interface
|
303 |
-
# iface = gr.Interface(
|
304 |
-
# fn=process_and_query,
|
305 |
-
# inputs=[
|
306 |
-
# gr.Textbox(label="Input Text"),
|
307 |
-
# gr.Image(label="Upload Image"),
|
308 |
-
# gr.Audio(label="talk in french",
|
309 |
-
# sources=["microphone"]),
|
310 |
-
# ],
|
311 |
-
# outputs=[gr.Markdown(label="Output Text")],
|
312 |
-
# title="👋🏻Welcome to ⚕🗣️😷MultiMed - Access Chat ⚕🗣️😷",
|
313 |
-
# description='''
|
314 |
-
# ### How To Use ⚕🗣️😷MultiMed⚕:
|
315 |
-
# #### 🗣️📝Interact with ⚕🗣️😷MultiMed⚕ in any language using audio or text!
|
316 |
-
# #### 🗣️📝 This is an educational and accessible conversational tool to improve wellness and sanitation in support of public health.
|
317 |
-
# #### 📚🌟💼 The knowledge base is composed of publicly available medical and health sources in multiple languages. We also used [Kelvalya/MedAware](https://huggingface.co/datasets/keivalya/MedQuad-MedicalQnADataset) that we processed and converted to HTML. The quality of the answers depends on the quality of the dataset, so if you want to see some data represented here, do [get in touch](https://discord.gg/GWpVpekp). You can also use 😷MultiMed⚕️ on your own data & in your own way by cloning this space. 🧬🔬🔍 Simply click here: <a style="display:inline-block" href="https://huggingface.co/spaces/TeamTonic/MultiMed?duplicate=true"><img src="https://img.shields.io/badge/-Duplicate%20Space-blue?labelColor=white&style=flat&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAP5JREFUOE+lk7FqAkEURY+ltunEgFXS2sZGIbXfEPdLlnxJyDdYB62sbbUKpLbVNhyYFzbrrA74YJlh9r079973psed0cvUD4A+4HoCjsA85X0Dfn/RBLBgBDxnQPfAEJgBY+A9gALA4tcbamSzS4xq4FOQAJgCDwV2CPKV8tZAJcAjMMkUe1vX+U+SMhfAJEHasQIWmXNN3abzDwHUrgcRGmYcgKe0bxrblHEB4E/pndMazNpSZGcsZdBlYJcEL9Afo75molJyM2FxmPgmgPqlWNLGfwZGG6UiyEvLzHYDmoPkDDiNm9JR9uboiONcBXrpY1qmgs21x1QwyZcpvxt9NS09PlsPAAAAAElFTkSuQmCC&logoWidth=14" alt="Duplicate Space"></a></h3>
|
318 |
-
# #### Join us : 🌟TeamTonic🌟 is always making cool demos! Join our active builder's🛠️community on 👻Discord: [Discord](https://discord.gg/GWpVpekp) On 🤗Huggingface: [TeamTonic](https://huggingface.co/TeamTonic) & [MultiTransformer](https://huggingface.co/MultiTransformer) On 🌐Github: [Polytonic](https://github.com/tonic-ai) & contribute to 🌟 [PolyGPT](https://github.com/tonic-ai/polygpt-alpha)"
|
319 |
-
# ''',
|
320 |
-
# theme='ParityError/Anime',
|
321 |
-
# examples=[
|
322 |
-
# ["What is the proper treatment for buccal herpes?"],
|
323 |
-
# ["Male, 40 presenting with swollen glands and a rash"],
|
324 |
-
# ["How does cellular metabolism work TCA cycle"],
|
325 |
-
# ["What special care must be provided to children with chicken pox?"],
|
326 |
-
# ["When and how often should I wash my hands ?"],
|
327 |
-
# ["بکل ہرپس کا صحیح علاج کیا ہے؟"],
|
328 |
-
# ["구강 헤르페스의 적절한 치료법은 무엇입니까?"],
|
329 |
-
# ["Je, ni matibabu gani sahihi kwa herpes ya buccal?"],
|
330 |
-
# ],
|
331 |
-
# )
|
332 |
-
|
333 |
welcome_message = """
|
334 |
# 👋🏻Welcome to ⚕🗣️😷MultiMed - Access Chat ⚕🗣️😷
|
335 |
### How To Use ⚕🗣️😷MultiMed⚕:
|
|
|
261 |
try:
|
262 |
# augment the prompt before feeding it to vectara
|
263 |
text = "the user asks the following to his health adviser " + text
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
264 |
|
265 |
# Use the text to query Vectara
|
266 |
vectara_response_json = query_vectara(text)
|
|
|
289 |
return str(e)
|
290 |
|
291 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
292 |
welcome_message = """
|
293 |
# 👋🏻Welcome to ⚕🗣️😷MultiMed - Access Chat ⚕🗣️😷
|
294 |
### How To Use ⚕🗣️😷MultiMed⚕:
|