Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -160,7 +160,7 @@ def predict(message, history):
|
|
| 160 |
if new_token != '<':
|
| 161 |
partial_message += new_token
|
| 162 |
yield partial_message
|
| 163 |
-
return messages
|
| 164 |
|
| 165 |
# Define the Gradio interface
|
| 166 |
title = "Tchap"
|
|
@@ -172,12 +172,11 @@ examples = [
|
|
| 172 |
]
|
| 173 |
]
|
| 174 |
|
| 175 |
-
|
|
|
|
| 176 |
with gr.Blocks() as demo:
|
| 177 |
-
|
| 178 |
-
|
| 179 |
-
source_display = gr.HTML()
|
| 180 |
-
chat_box.change(source_display.update) # Use the change event to update the HTML component
|
| 181 |
|
| 182 |
if __name__ == "__main__":
|
| 183 |
demo.queue().launch()
|
|
|
|
| 160 |
if new_token != '<':
|
| 161 |
partial_message += new_token
|
| 162 |
yield partial_message
|
| 163 |
+
return messages
|
| 164 |
|
| 165 |
# Define the Gradio interface
|
| 166 |
title = "Tchap"
|
|
|
|
| 172 |
]
|
| 173 |
]
|
| 174 |
|
| 175 |
+
demo = gr.Blocks()
|
| 176 |
+
|
| 177 |
with gr.Blocks() as demo:
|
| 178 |
+
gr.ChatInterface(predict)
|
| 179 |
+
gr.HTML("""<h3 style="text-align:center">Sources</h3><p>""" + source_text + """</p>""")
|
|
|
|
|
|
|
| 180 |
|
| 181 |
if __name__ == "__main__":
|
| 182 |
demo.queue().launch()
|