HookBeforeAppDelegate commited on
Commit
e723c27
·
verified ·
1 Parent(s): 720f6ed

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -136,7 +136,7 @@ with gr.Blocks(css = """#col_container { margin-left: auto; margin-right: auto;}
136
  gr.HTML("""<h3 align="center">This app provides you full access to GPT-4o mini (128K token limit). You don't need any OPENAI API key.</h3>""")
137
 
138
  #gr.HTML('''<center><a href="https://huggingface.co/spaces/ysharma/ChatGPT4?duplicate=true"><img src="https://bit.ly/3gLdBN6" alt="Duplicate Space"></a>Duplicate the Space and run securely with your OpenAI API Key</center>''')
139
- with gr.Column(elem_id = "col_container", visible=False) as main_block:
140
  #GPT4 API Key is provided by Huggingface
141
  #openai_api_key = gr.Textbox(type='password', label="Enter only your GPT4 OpenAI API key here")
142
  chatbot = gr.Chatbot(elem_id='chatbot') #c
@@ -180,9 +180,8 @@ with gr.Blocks(css = """#col_container { margin-left: auto; margin-right: auto;}
180
  #
181
  # accept_button.click(None, None, accept_checkbox, js=js, queue=False)
182
  # accept_checkbox.change(fn=enable_inputs, inputs=[], outputs=[user_consent_block, main_block], queue=False)
183
- main_block()
184
 
185
- gr.update(visible=False), gr.update(visible=True)
186
  inputs.submit(reset_textbox, [], [inputs, b1], queue=False)
187
  inputs.submit(predict, [inputs, top_p, temperature, chat_counter, chatbot, state], [chatbot, state, chat_counter, server_status_code, inputs, b1],) #openai_api_key
188
  b1.click(reset_textbox, [], [inputs, b1], queue=False)
@@ -191,3 +190,4 @@ with gr.Blocks(css = """#col_container { margin-left: auto; margin-right: auto;}
191
  demo.queue(max_size=10, default_concurrency_limit=NUM_THREADS, api_open=False).launch(share=False)
192
 
193
 
 
 
136
  gr.HTML("""<h3 align="center">This app provides you full access to GPT-4o mini (128K token limit). You don't need any OPENAI API key.</h3>""")
137
 
138
  #gr.HTML('''<center><a href="https://huggingface.co/spaces/ysharma/ChatGPT4?duplicate=true"><img src="https://bit.ly/3gLdBN6" alt="Duplicate Space"></a>Duplicate the Space and run securely with your OpenAI API Key</center>''')
139
+ with gr.Column(elem_id = "col_container", visible=True) as main_block:
140
  #GPT4 API Key is provided by Huggingface
141
  #openai_api_key = gr.Textbox(type='password', label="Enter only your GPT4 OpenAI API key here")
142
  chatbot = gr.Chatbot(elem_id='chatbot') #c
 
180
  #
181
  # accept_button.click(None, None, accept_checkbox, js=js, queue=False)
182
  # accept_checkbox.change(fn=enable_inputs, inputs=[], outputs=[user_consent_block, main_block], queue=False)
 
183
 
184
+
185
  inputs.submit(reset_textbox, [], [inputs, b1], queue=False)
186
  inputs.submit(predict, [inputs, top_p, temperature, chat_counter, chatbot, state], [chatbot, state, chat_counter, server_status_code, inputs, b1],) #openai_api_key
187
  b1.click(reset_textbox, [], [inputs, b1], queue=False)
 
190
  demo.queue(max_size=10, default_concurrency_limit=NUM_THREADS, api_open=False).launch(share=False)
191
 
192
 
193
+