Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -16,7 +16,7 @@ with gr.Blocks(theme=gr.themes.Monochrome(),css="footer{display:none !important}
|
|
| 16 |
user_id = gr.TextArea(visible=False) # Displaying the user id, it is made not-visible because the id hasnt been created yet and we dont want the user seeing it anyway.
|
| 17 |
notifier = gr.HTML(visible=False)
|
| 18 |
|
| 19 |
-
@chatblock.load(outputs=[user_id]) # When the chatblock loads we send the information from the following function "load_user" to "user_id".
|
| 20 |
def load_user(): # When the chatblock loads, the message history is initialized, the instructions are initialized, and the users id is created, sent, and made visible to the ui variable above.
|
| 21 |
global message_history # Made global variables so we can use them in the "predict_prompt" function.
|
| 22 |
global instructions
|
|
|
|
| 16 |
user_id = gr.TextArea(visible=False) # Displaying the user id, it is made not-visible because the id hasnt been created yet and we dont want the user seeing it anyway.
|
| 17 |
notifier = gr.HTML(visible=False)
|
| 18 |
|
| 19 |
+
@chatblock.load(outputs=[user_id,notifier]) # When the chatblock loads we send the information from the following function "load_user" to "user_id".
|
| 20 |
def load_user(): # When the chatblock loads, the message history is initialized, the instructions are initialized, and the users id is created, sent, and made visible to the ui variable above.
|
| 21 |
global message_history # Made global variables so we can use them in the "predict_prompt" function.
|
| 22 |
global instructions
|