Spaces:
Sleeping
Sleeping
Create app.py
Browse files
app.py
CHANGED
|
@@ -58,6 +58,17 @@ button:hover {
|
|
| 58 |
}
|
| 59 |
"""
|
| 60 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 61 |
# Build Gradio interface
|
| 62 |
with gr.Blocks(css=custom_css) as interface:
|
| 63 |
gr.Markdown("<h1>Healthwise AI Assistant 🚑</h1>")
|
|
@@ -83,4 +94,4 @@ with gr.Blocks(css=custom_css) as interface:
|
|
| 83 |
|
| 84 |
submit_button.click(generate_response, inputs=[input_text, no_words, user_type, model_type], outputs=response)
|
| 85 |
|
| 86 |
-
interface.launch()
|
|
|
|
| 58 |
}
|
| 59 |
"""
|
| 60 |
|
| 61 |
+
# Define the generate_response function
|
| 62 |
+
def generate_response(input_text, no_words, user_type, model_type):
|
| 63 |
+
if model_type == "DialoGPT":
|
| 64 |
+
return Get_DialoGPT_Response(input_text, no_words, user_type)
|
| 65 |
+
elif model_type == "DistilGPT":
|
| 66 |
+
return Get_DistilGPT_Response(input_text, no_words, user_type)
|
| 67 |
+
elif model_type == "MedGPT":
|
| 68 |
+
return Get_MedGPT_Response(input_text, no_words, user_type)
|
| 69 |
+
else:
|
| 70 |
+
return "Invalid model type selected."
|
| 71 |
+
|
| 72 |
# Build Gradio interface
|
| 73 |
with gr.Blocks(css=custom_css) as interface:
|
| 74 |
gr.Markdown("<h1>Healthwise AI Assistant 🚑</h1>")
|
|
|
|
| 94 |
|
| 95 |
submit_button.click(generate_response, inputs=[input_text, no_words, user_type, model_type], outputs=response)
|
| 96 |
|
| 97 |
+
interface.launch()
|