Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -12,7 +12,7 @@ model = None
|
|
12 |
tokenizer = None
|
13 |
generator = None
|
14 |
csv_name = "disease_database_mini.csv"
|
15 |
-
|
16 |
df = pd.read_csv(csv_name)
|
17 |
|
18 |
|
@@ -115,7 +115,10 @@ def csv_prompter(question,csv_name):
|
|
115 |
return answer_llm
|
116 |
|
117 |
|
118 |
-
|
|
|
|
|
|
|
119 |
|
120 |
with gr.Blocks() as demo:
|
121 |
gr.Markdown("## Autonomous ChatDoctor (openai version), based on disease database knowledge")
|
@@ -159,6 +162,17 @@ with gr.Blocks() as demo:
|
|
159 |
clear.click(lambda: None, None, chatbot, queue=False).then(restart, chatbot, chatbot)
|
160 |
Initialization.click(lambda: None, None, chatbot, queue=False).then(restart, chatbot, chatbot)
|
161 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
162 |
if __name__ == "__main__":
|
163 |
demo.launch()
|
164 |
|
|
|
12 |
tokenizer = None
|
13 |
generator = None
|
14 |
csv_name = "disease_database_mini.csv"
|
15 |
+
global df
|
16 |
df = pd.read_csv(csv_name)
|
17 |
|
18 |
|
|
|
115 |
return answer_llm
|
116 |
|
117 |
|
118 |
+
def filter_records(records):
|
119 |
+
df = records[1:]
|
120 |
+
return df
|
121 |
+
|
122 |
|
123 |
with gr.Blocks() as demo:
|
124 |
gr.Markdown("## Autonomous ChatDoctor (openai version), based on disease database knowledge")
|
|
|
162 |
clear.click(lambda: None, None, chatbot, queue=False).then(restart, chatbot, chatbot)
|
163 |
Initialization.click(lambda: None, None, chatbot, queue=False).then(restart, chatbot, chatbot)
|
164 |
|
165 |
+
|
166 |
+
gr.Interface(
|
167 |
+
filter_records,
|
168 |
+
[
|
169 |
+
gr.Dataframe(
|
170 |
+
df
|
171 |
+
),
|
172 |
+
],
|
173 |
+
"dataframe",
|
174 |
+
description="Disease Database",)
|
175 |
+
|
176 |
if __name__ == "__main__":
|
177 |
demo.launch()
|
178 |
|