Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,24 +1,16 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
-
from pipeline import run_with_chain
|
| 3 |
|
| 4 |
-
# Define a function that connects the Gradio interface to the pipeline
|
| 5 |
def ask_dailywellness(query: str) -> str:
|
| 6 |
-
|
| 7 |
-
# Call the run_with_chain function that processes the query
|
| 8 |
-
response = run_with_chain(query)
|
| 9 |
-
return response
|
| 10 |
-
except Exception as e:
|
| 11 |
-
return f"Error processing your request: {str(e)}"
|
| 12 |
|
| 13 |
-
# Define the Gradio interface
|
| 14 |
interface = gr.Interface(
|
| 15 |
fn=ask_dailywellness,
|
| 16 |
inputs=gr.Textbox(lines=2, label="Ask DailyWellnessAI"),
|
| 17 |
outputs=gr.Textbox(label="DailyWellnessAI Answer"),
|
| 18 |
title="DailyWellnessAI",
|
| 19 |
-
description="Ask about wellness or DailyWellnessAI brand. Out-of-scope
|
| 20 |
)
|
| 21 |
|
| 22 |
if __name__ == "__main__":
|
| 23 |
-
|
| 24 |
-
interface.launch(server_name="0.0.0.0", server_port=7860, share=True)
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
+
from pipeline import run_with_chain
|
| 3 |
|
|
|
|
| 4 |
def ask_dailywellness(query: str) -> str:
|
| 5 |
+
return run_with_chain(query)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
|
|
|
|
| 7 |
interface = gr.Interface(
|
| 8 |
fn=ask_dailywellness,
|
| 9 |
inputs=gr.Textbox(lines=2, label="Ask DailyWellnessAI"),
|
| 10 |
outputs=gr.Textbox(label="DailyWellnessAI Answer"),
|
| 11 |
title="DailyWellnessAI",
|
| 12 |
+
description="Ask about wellness or DailyWellnessAI brand. Out-of-scope"
|
| 13 |
)
|
| 14 |
|
| 15 |
if __name__ == "__main__":
|
| 16 |
+
interface.launch(server_name="0.0.0.0", server_port=7860)
|
|
|