Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -48,40 +48,15 @@ rag_chain = (
|
|
48 |
)
|
49 |
import gradio as gr
|
50 |
|
51 |
-
|
|
|
52 |
partial_text = ""
|
53 |
-
for new_text in rag_chain.stream(
|
54 |
partial_text += new_text
|
55 |
yield partial_text
|
56 |
|
57 |
examples = ['I feel dizzy', 'what is the possible sickness for fatigue']
|
58 |
|
59 |
-
with open('index.html', 'r') as file:
|
60 |
-
custom_html = file.read()
|
61 |
-
css = """body {
|
62 |
-
font-family: Arial, sans-serif;
|
63 |
-
background-color: #f0f0f0;
|
64 |
-
display: flex;
|
65 |
-
justify-content: center;
|
66 |
-
align-items: center;
|
67 |
-
height: 100vh;
|
68 |
-
margin: 0;
|
69 |
-
}
|
70 |
-
|
71 |
-
.chat-container {
|
72 |
-
background-color: white;
|
73 |
-
border-radius: 10px;
|
74 |
-
box-shadow: 0 4px 8px rgba(0,0,0,0.1);
|
75 |
-
padding: 20px;
|
76 |
-
width: 100%;
|
77 |
-
max-width: 600px;
|
78 |
-
}
|
79 |
-
|
80 |
-
h1 {
|
81 |
-
text-align: center;
|
82 |
-
color: #333;
|
83 |
-
}
|
84 |
-
"""
|
85 |
|
86 |
title = "MediGuide ChatBot"
|
87 |
demo = gr.Interface(
|
@@ -90,8 +65,9 @@ demo = gr.Interface(
|
|
90 |
inputs="text",
|
91 |
outputs="text",
|
92 |
examples=examples,
|
93 |
-
css=css,
|
94 |
allow_flagging="never",
|
|
|
|
|
95 |
)
|
96 |
|
97 |
|
|
|
48 |
)
|
49 |
import gradio as gr
|
50 |
|
51 |
+
|
52 |
+
def rag_memory_stream(message, history):
|
53 |
partial_text = ""
|
54 |
+
for new_text in rag_chain.stream(message):
|
55 |
partial_text += new_text
|
56 |
yield partial_text
|
57 |
|
58 |
examples = ['I feel dizzy', 'what is the possible sickness for fatigue']
|
59 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
60 |
|
61 |
title = "MediGuide ChatBot"
|
62 |
demo = gr.Interface(
|
|
|
65 |
inputs="text",
|
66 |
outputs="text",
|
67 |
examples=examples,
|
|
|
68 |
allow_flagging="never",
|
69 |
+
fill_height=True,
|
70 |
+
theme="glass",
|
71 |
)
|
72 |
|
73 |
|