Spaces:
Running
Running
Commit
·
daa80d3
1
Parent(s):
4e436d6
Fixing the empty response issue
Browse files
main.py
CHANGED
|
@@ -164,7 +164,8 @@ def run_model(message, history):
|
|
| 164 |
})
|
| 165 |
yield "", history
|
| 166 |
for messages in model_manager.run(history):
|
| 167 |
-
|
|
|
|
| 168 |
|
| 169 |
|
| 170 |
with gr.Blocks() as login:
|
|
@@ -191,7 +192,7 @@ with gr.Blocks(title="HASHIRU AI", css=css, fill_width=True, fill_height=True) a
|
|
| 191 |
with gr.Column(scale=0):
|
| 192 |
gr.Markdown(_header_html)
|
| 193 |
gr.Button("Logout", link="/logout")
|
| 194 |
-
|
| 195 |
with gr.Column(scale=1):
|
| 196 |
model_dropdown = gr.Dropdown(
|
| 197 |
choices=[mode.name for mode in Mode],
|
|
@@ -228,6 +229,7 @@ if __name__ == "__main__":
|
|
| 228 |
import uvicorn
|
| 229 |
|
| 230 |
if no_auth:
|
| 231 |
-
demo.launch(favicon_path="favicon.ico",
|
|
|
|
| 232 |
else:
|
| 233 |
uvicorn.run(app, host="0.0.0.0", port=7860)
|
|
|
|
| 164 |
})
|
| 165 |
yield "", history
|
| 166 |
for messages in model_manager.run(history):
|
| 167 |
+
if messages[-1]["role"] == "assistant":
|
| 168 |
+
yield messages[-1], messages
|
| 169 |
|
| 170 |
|
| 171 |
with gr.Blocks() as login:
|
|
|
|
| 192 |
with gr.Column(scale=0):
|
| 193 |
gr.Markdown(_header_html)
|
| 194 |
gr.Button("Logout", link="/logout")
|
| 195 |
+
|
| 196 |
with gr.Column(scale=1):
|
| 197 |
model_dropdown = gr.Dropdown(
|
| 198 |
choices=[mode.name for mode in Mode],
|
|
|
|
| 229 |
import uvicorn
|
| 230 |
|
| 231 |
if no_auth:
|
| 232 |
+
demo.launch(favicon_path="favicon.ico",
|
| 233 |
+
share=True, server_name="localhost")
|
| 234 |
else:
|
| 235 |
uvicorn.run(app, host="0.0.0.0", port=7860)
|