Update app.py
Browse files
app.py
CHANGED
|
@@ -142,7 +142,8 @@ def generate(
|
|
| 142 |
|
| 143 |
# Use the global variable to store the chat history
|
| 144 |
# global global_chat_history
|
| 145 |
-
|
|
|
|
| 146 |
|
| 147 |
# Move the condition here after the assignment
|
| 148 |
if input_prompt:
|
|
@@ -274,9 +275,13 @@ with gr.Blocks(css="style.css") as demo:
|
|
| 274 |
input_prompt += f"{user} [/INST] {assistant} <s>[INST] "
|
| 275 |
input_prompt += f"{message} [/INST] "
|
| 276 |
return input_prompt
|
|
|
|
|
|
|
|
|
|
| 277 |
|
| 278 |
-
|
| 279 |
-
|
|
|
|
| 280 |
demo.load(
|
| 281 |
fn=lambda x: x,
|
| 282 |
inputs=[url_params],
|
|
@@ -284,13 +289,6 @@ with gr.Blocks(css="style.css") as demo:
|
|
| 284 |
_js=get_window_url_params(),
|
| 285 |
queue=False
|
| 286 |
)
|
| 287 |
-
|
| 288 |
-
chat_interface.render()
|
| 289 |
-
#gr.Markdown(LICENSE)
|
| 290 |
-
|
| 291 |
-
if __name__ == "__main__":
|
| 292 |
-
#demo.queue(max_size=20).launch()
|
| 293 |
-
demo.queue(max_size=20)
|
| 294 |
demo.launch(share=True, debug=True)
|
| 295 |
|
| 296 |
# Register the function to be called when the program exits
|
|
|
|
| 142 |
|
| 143 |
# Use the global variable to store the chat history
|
| 144 |
# global global_chat_history
|
| 145 |
+
|
| 146 |
+
conversation = []
|
| 147 |
|
| 148 |
# Move the condition here after the assignment
|
| 149 |
if input_prompt:
|
|
|
|
| 275 |
input_prompt += f"{user} [/INST] {assistant} <s>[INST] "
|
| 276 |
input_prompt += f"{message} [/INST] "
|
| 277 |
return input_prompt
|
| 278 |
+
|
| 279 |
+
chat_interface.render()
|
| 280 |
+
#gr.Markdown(LICENSE)
|
| 281 |
|
| 282 |
+
if __name__ == "__main__":
|
| 283 |
+
#demo.queue(max_size=20).launch()
|
| 284 |
+
demo.queue(max_size=20)
|
| 285 |
demo.load(
|
| 286 |
fn=lambda x: x,
|
| 287 |
inputs=[url_params],
|
|
|
|
| 289 |
_js=get_window_url_params(),
|
| 290 |
queue=False
|
| 291 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 292 |
demo.launch(share=True, debug=True)
|
| 293 |
|
| 294 |
# Register the function to be called when the program exits
|