Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -11,7 +11,7 @@ g = Github(os.getenv('GITHUB_KEY'))
|
|
| 11 |
|
| 12 |
user_dictionary = {} #A dictionary that we can save mutible server side information. This will be formatted {new_id:message_history}
|
| 13 |
|
| 14 |
-
with gr.Blocks(theme=gr.themes.Monochrome(),css="footer{display:none !important} progress-text{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.
|
| 15 |
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.
|
| 16 |
|
| 17 |
@chatblock.load(outputs=[user_id]) # When the chatblock loads we send the information from the following function "load_user" to "user_id".
|
|
@@ -19,7 +19,7 @@ with gr.Blocks(theme=gr.themes.Monochrome(),css="footer{display:none !important}
|
|
| 19 |
global message_history # Made global variables so we can use them in the "predict_prompt" function.
|
| 20 |
global instructions
|
| 21 |
global file_type
|
| 22 |
-
global user_dictionary
|
| 23 |
|
| 24 |
new_id = str(uuid.uuid4()) # Id created by uuid.
|
| 25 |
print("Loading in user: " + new_id)
|
|
|
|
| 11 |
|
| 12 |
user_dictionary = {} #A dictionary that we can save mutible server side information. This will be formatted {new_id:message_history}
|
| 13 |
|
| 14 |
+
with gr.Blocks(theme=gr.themes.Monochrome(),css="footer{display:none !important} progress-text{display:none !important}",css=".progress-text { 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.
|
| 15 |
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.
|
| 16 |
|
| 17 |
@chatblock.load(outputs=[user_id]) # When the chatblock loads we send the information from the following function "load_user" to "user_id".
|
|
|
|
| 19 |
global message_history # Made global variables so we can use them in the "predict_prompt" function.
|
| 20 |
global instructions
|
| 21 |
global file_type
|
| 22 |
+
global user_dictionary
|
| 23 |
|
| 24 |
new_id = str(uuid.uuid4()) # Id created by uuid.
|
| 25 |
print("Loading in user: " + new_id)
|