Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -10,7 +10,7 @@ openai.api_key = os.getenv('OPENAI_KEY') # Initializing secrets
|
|
| 10 |
with gr.Blocks(theme=gr.themes.Monochrome(),css="footer{display:none !important}") as chatblock: # Creating UI using gradio Blocks. This line sets the block as a variable called "chatblock", the theme as monochrome, and removes the footer of the page.
|
| 11 |
user_id = gr.Markdown(visible=False) # Displaying the user id, it is made not-visible because the id hasnt been created yet.
|
| 12 |
|
| 13 |
-
@chatblock.load(outputs=[user_id]) # When the chatblock loads we send the information from the following function
|
| 14 |
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.
|
| 15 |
global message_history # Made global variables so we can use them in the "predict_prompt" function.
|
| 16 |
global instructions
|
|
|
|
| 10 |
with gr.Blocks(theme=gr.themes.Monochrome(),css="footer{display:none !important}") as chatblock: # Creating UI using gradio Blocks. This line sets the block as a variable called "chatblock", the theme as monochrome, and removes the footer of the page.
|
| 11 |
user_id = gr.Markdown(visible=False) # Displaying the user id, it is made not-visible because the id hasnt been created yet.
|
| 12 |
|
| 13 |
+
@chatblock.load(outputs=[user_id]) # When the chatblock loads we send the information from the following function "load_user" to "user_id".
|
| 14 |
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.
|
| 15 |
global message_history # Made global variables so we can use them in the "predict_prompt" function.
|
| 16 |
global instructions
|