Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,16 +1,20 @@
|
|
|
|
|
|
1 |
import gradio as gr
|
2 |
import time
|
3 |
-
import Content as con
|
4 |
|
5 |
def random_response(message, history):
|
6 |
-
answer = con.starting(message.lower())
|
7 |
for i in range(len(answer)):
|
8 |
-
time.sleep(0.03)
|
9 |
yield answer[:i+1]
|
10 |
|
|
|
11 |
demo = gr.ChatInterface(random_response,
|
12 |
title="Prakriti Analyzer",
|
13 |
description="This bot helps you understand your body constitution or 'prakriti' using ancient Ayurveda principles."
|
14 |
).queue()
|
15 |
|
|
|
16 |
demo.launch(inbrowser=True)
|
|
|
1 |
+
# app.py - Gradio Interface
|
2 |
+
|
3 |
import gradio as gr
|
4 |
import time
|
5 |
+
import Content as con # Import the logic from Content.py
|
6 |
|
7 |
def random_response(message, history):
|
8 |
+
answer = con.starting(message.lower()) # Call the 'starting' function from Content
|
9 |
for i in range(len(answer)):
|
10 |
+
time.sleep(0.03) # Simulate a typing effect
|
11 |
yield answer[:i+1]
|
12 |
|
13 |
+
# Create Gradio Chat Interface
|
14 |
demo = gr.ChatInterface(random_response,
|
15 |
title="Prakriti Analyzer",
|
16 |
description="This bot helps you understand your body constitution or 'prakriti' using ancient Ayurveda principles."
|
17 |
).queue()
|
18 |
|
19 |
+
# Launch Gradio application
|
20 |
demo.launch(inbrowser=True)
|