Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -7,7 +7,7 @@ df = df[['drug_name', 'medical_condition', 'side_effects']]
|
|
| 7 |
df.dropna(inplace=True)
|
| 8 |
|
| 9 |
context_data = []
|
| 10 |
-
for i in range(
|
| 11 |
context = " | ".join([f"{col}: {df.iloc[i][col]}" for col in df.columns])
|
| 12 |
context_data.append(context)
|
| 13 |
|
|
@@ -90,20 +90,28 @@ Disclaimer: This chatbot is for informational purposes only and not a substitute
|
|
| 90 |
"""
|
| 91 |
|
| 92 |
# Customizing Gradio interface for a better look
|
| 93 |
-
demo = gr.Interface(
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 107 |
)
|
| 108 |
|
| 109 |
if __name__ == "__main__":
|
|
|
|
| 7 |
df.dropna(inplace=True)
|
| 8 |
|
| 9 |
context_data = []
|
| 10 |
+
for i in range(2):
|
| 11 |
context = " | ".join([f"{col}: {df.iloc[i][col]}" for col in df.columns])
|
| 12 |
context_data.append(context)
|
| 13 |
|
|
|
|
| 90 |
"""
|
| 91 |
|
| 92 |
# Customizing Gradio interface for a better look
|
| 93 |
+
# demo = gr.Interface(
|
| 94 |
+
# fn=rag_memory_stream,
|
| 95 |
+
# inputs=gr.Textbox(
|
| 96 |
+
# lines=5,
|
| 97 |
+
# placeholder="Type your medical question here...",
|
| 98 |
+
# label="Your Medical Question"
|
| 99 |
+
# ),
|
| 100 |
+
# outputs=gr.Textbox(
|
| 101 |
+
# lines=15, # Reduced line count for better layout
|
| 102 |
+
# label="AI Response"
|
| 103 |
+
# ),
|
| 104 |
+
# title=title,
|
| 105 |
+
# description=description,
|
| 106 |
+
# allow_flagging="never"
|
| 107 |
+
# )
|
| 108 |
+
|
| 109 |
+
demo = gr.ChatInterface(fn=rag_memory_stream,
|
| 110 |
+
type="messages",
|
| 111 |
+
title=title,
|
| 112 |
+
description=description,
|
| 113 |
+
fill_height=True,
|
| 114 |
+
theme="glass",
|
| 115 |
)
|
| 116 |
|
| 117 |
if __name__ == "__main__":
|