kavansaun commited on
Commit
912fe58
·
verified ·
1 Parent(s): def3e77

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -11,7 +11,7 @@ g = Github(os.getenv('GITHUB_KEY'))
11
  user_dictionary = {}
12
 
13
  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.
14
- user_id = gr.TextArea(visible=False) # Displaying the user id, it is made not-visible because the id hasnt been created yet.
15
 
16
  @chatblock.load(outputs=[user_id]) # When the chatblock loads we send the information from the following function "load_user" to "user_id".
17
  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.
@@ -31,7 +31,7 @@ with gr.Blocks(theme=gr.themes.Monochrome(),css="footer{display:none !important}
31
  filename = str(new_id) + '.txt'
32
  repo.create_file(filename, "Saving" + filename, "")
33
 
34
- return gr.TextArea(new_id,visible=True) # Returning the "TextArea" object with what we want.
35
 
36
  initial_message = "Please write your prompt here and press 'enter'" # Initial message for the User Interface (basically the message for the typing input area so change the message under the quotes if you want to change that)
37
 
 
11
  user_dictionary = {}
12
 
13
  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.
14
+ 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.
15
 
16
  @chatblock.load(outputs=[user_id]) # When the chatblock loads we send the information from the following function "load_user" to "user_id".
17
  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.
 
31
  filename = str(new_id) + '.txt'
32
  repo.create_file(filename, "Saving" + filename, "")
33
 
34
+ return gr.TextArea(new_id,visible=False) # Returning the "TextArea" object with what we want. Set visible to True if you want the id to appear when its made.
35
 
36
  initial_message = "Please write your prompt here and press 'enter'" # Initial message for the User Interface (basically the message for the typing input area so change the message under the quotes if you want to change that)
37