Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,7 +1,12 @@
|
|
1 |
import gradio as gr
|
2 |
from pipeline import run_with_chain
|
3 |
def ask_dailywellness(query: str) -> str:
|
4 |
-
|
|
|
|
|
|
|
|
|
|
|
5 |
interface = gr. Interface (
|
6 |
fn=ask_dailywellness,
|
7 |
inputs=gr.Textbox(lines=2, label="Ask DailyWellnessAI"),
|
|
|
1 |
import gradio as gr
|
2 |
from pipeline import run_with_chain
|
3 |
def ask_dailywellness(query: str) -> str:
|
4 |
+
# Ensure that the query passed to run_with_chain is a valid string
|
5 |
+
if isinstance(query, str):
|
6 |
+
return run_with_chain(query)
|
7 |
+
else:
|
8 |
+
# If for some reason the query is not a string, return an error message
|
9 |
+
return "Invalid input. Please enter a valid query."
|
10 |
interface = gr. Interface (
|
11 |
fn=ask_dailywellness,
|
12 |
inputs=gr.Textbox(lines=2, label="Ask DailyWellnessAI"),
|