Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -18,7 +18,6 @@ with gr.Blocks(theme=gr.themes.Monochrome(),css="footer{display:none !important}
|
|
| 18 |
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.
|
| 19 |
global message_history # Made global variables so we can use them in the "predict_prompt" function.
|
| 20 |
global instructions
|
| 21 |
-
global filename
|
| 22 |
global user_dictionary # Pretty sure setting this as global is the only way to get it in the scope of this function but I dont know. This might be a leak for the user dictionary.
|
| 23 |
|
| 24 |
new_id = str(uuid.uuid4()) # Id created by uuid.
|
|
@@ -74,7 +73,7 @@ with gr.Blocks(theme=gr.themes.Monochrome(),css="footer{display:none !important}
|
|
| 74 |
print(content)
|
| 75 |
|
| 76 |
#updating the repository with the entire message history
|
| 77 |
-
file = repo.get_contents(
|
| 78 |
repo.update_file(file.path, commit_message, content, file.sha)
|
| 79 |
|
| 80 |
return response # Returning the chat bot response
|
|
|
|
| 18 |
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.
|
| 19 |
global message_history # Made global variables so we can use them in the "predict_prompt" function.
|
| 20 |
global instructions
|
|
|
|
| 21 |
global user_dictionary # Pretty sure setting this as global is the only way to get it in the scope of this function but I dont know. This might be a leak for the user dictionary.
|
| 22 |
|
| 23 |
new_id = str(uuid.uuid4()) # Id created by uuid.
|
|
|
|
| 73 |
print(content)
|
| 74 |
|
| 75 |
#updating the repository with the entire message history
|
| 76 |
+
file = repo.get_contents(user_id + ".txt")
|
| 77 |
repo.update_file(file.path, commit_message, content, file.sha)
|
| 78 |
|
| 79 |
return response # Returning the chat bot response
|