Update app.py
Browse files
app.py
CHANGED
|
@@ -194,10 +194,11 @@ with gr.Blocks(title="Medicine Assistant") as app:
|
|
| 194 |
)
|
| 195 |
|
| 196 |
# Create a file input for CSV that can be shared between tabs
|
|
|
|
| 197 |
csv_file_input = gr.File(
|
| 198 |
label="Upload Medicine CSV (Optional)",
|
| 199 |
file_types=[".csv"],
|
| 200 |
-
type="file
|
| 201 |
)
|
| 202 |
gr.Markdown("If no CSV is uploaded, the app will use the default 'medicine_dataset.csv' file.")
|
| 203 |
|
|
@@ -225,7 +226,7 @@ with gr.Blocks(title="Medicine Assistant") as app:
|
|
| 225 |
|
| 226 |
recommend_from_extract_btn.click(
|
| 227 |
fn=send_medicine_to_recommender,
|
| 228 |
-
inputs=[api_key_input, extracted_output, csv_file_input],
|
| 229 |
outputs=recommendation_from_extract_output
|
| 230 |
)
|
| 231 |
|
|
@@ -259,7 +260,7 @@ with gr.Blocks(title="Medicine Assistant") as app:
|
|
| 259 |
|
| 260 |
submit_btn.click(
|
| 261 |
recommend_medicine,
|
| 262 |
-
inputs=[api_key_input, medicine_name, csv_file_input],
|
| 263 |
outputs=recommendation_output
|
| 264 |
)
|
| 265 |
|
|
|
|
| 194 |
)
|
| 195 |
|
| 196 |
# Create a file input for CSV that can be shared between tabs
|
| 197 |
+
# Fixed the 'type' parameter to use 'filepath' instead of 'file'
|
| 198 |
csv_file_input = gr.File(
|
| 199 |
label="Upload Medicine CSV (Optional)",
|
| 200 |
file_types=[".csv"],
|
| 201 |
+
type="filepath" # Changed from 'file' to 'filepath'
|
| 202 |
)
|
| 203 |
gr.Markdown("If no CSV is uploaded, the app will use the default 'medicine_dataset.csv' file.")
|
| 204 |
|
|
|
|
| 226 |
|
| 227 |
recommend_from_extract_btn.click(
|
| 228 |
fn=send_medicine_to_recommender,
|
| 229 |
+
inputs=[api_key_input, extracted_output, csv_file_input],
|
| 230 |
outputs=recommendation_from_extract_output
|
| 231 |
)
|
| 232 |
|
|
|
|
| 260 |
|
| 261 |
submit_btn.click(
|
| 262 |
recommend_medicine,
|
| 263 |
+
inputs=[api_key_input, medicine_name, csv_file_input],
|
| 264 |
outputs=recommendation_output
|
| 265 |
)
|
| 266 |
|