Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -11,8 +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 |
-
|
| 15 |
-
with gr.Blocks(theme='abidlabs/dracula_test',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.
|
| 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 |
|
| 18 |
@chatblock.load(outputs=[user_id]) # When the chatblock loads we send the information from the following function "load_user" to "user_id".
|
|
@@ -92,6 +91,6 @@ with gr.Blocks(theme='abidlabs/dracula_test',css="footer{display:none !important
|
|
| 92 |
|
| 93 |
# Adding the messages into the row with gradio.
|
| 94 |
txt.submit(predict_prompt, [txt, user_id], Chatbot)
|
| 95 |
-
txt.submit(None,None,txt,
|
| 96 |
|
| 97 |
chatblock.launch() # launch!
|
|
|
|
| 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}") 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".
|
|
|
|
| 91 |
|
| 92 |
# Adding the messages into the row with gradio.
|
| 93 |
txt.submit(predict_prompt, [txt, user_id], Chatbot)
|
| 94 |
+
txt.submit(None,None,txt, value='')
|
| 95 |
|
| 96 |
chatblock.launch() # launch!
|