Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -12,7 +12,6 @@ model = None
|
|
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,10 +114,6 @@ def csv_prompter(question,csv_name):
|
|
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")
|
@@ -161,18 +156,9 @@ with gr.Blocks() as demo:
|
|
161 |
)
|
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 |
|
|
|
12 |
tokenizer = None
|
13 |
generator = None
|
14 |
csv_name = "disease_database_mini.csv"
|
|
|
15 |
df = pd.read_csv(csv_name)
|
16 |
|
17 |
|
|
|
114 |
return answer_llm
|
115 |
|
116 |
|
|
|
|
|
|
|
|
|
117 |
|
118 |
with gr.Blocks() as demo:
|
119 |
gr.Markdown("## Autonomous ChatDoctor (openai version), based on disease database knowledge")
|
|
|
156 |
)
|
157 |
clear.click(lambda: None, None, chatbot, queue=False).then(restart, chatbot, chatbot)
|
158 |
Initialization.click(lambda: None, None, chatbot, queue=False).then(restart, chatbot, chatbot)
|
159 |
+
gr.Dataframe(df)
|
160 |
|
161 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
162 |
if __name__ == "__main__":
|
163 |
demo.launch()
|
164 |
|