charbaaz356 commited on
Commit
eb5ce30
·
1 Parent(s): f75018b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -1
app.py CHANGED
@@ -874,7 +874,16 @@ with gr.Blocks(css=".gradio-container {background-color: lightgray}") as block:
874
  qa_chain_state, docsearch_state, use_embeddings_state],
875
  outputs=[chatbot, history_state, video_html, my_file, audio_html, tmp_aud_file, message])
876
  # outputs=[chatbot, history_state, audio_html, tmp_aud_file, message])
 
 
 
877
 
 
 
 
 
 
 
878
  openai_api_key_textbox.change(None,
879
  inputs=[openai_api_key_textbox],
880
  outputs=None, _js="(api_key) => localStorage.setItem('open_api_key', api_key)")
@@ -887,4 +896,4 @@ with gr.Blocks(css=".gradio-container {background-color: lightgray}") as block:
887
  block.load(None, inputs=None, outputs=openai_api_key_textbox, _js="()=> localStorage.getItem('open_api_key')")
888
 
889
 
890
- block.launch(debug=True)
 
874
  qa_chain_state, docsearch_state, use_embeddings_state],
875
  outputs=[chatbot, history_state, video_html, my_file, audio_html, tmp_aud_file, message])
876
  # outputs=[chatbot, history_state, audio_html, tmp_aud_file, message])
877
+ openai_api_key_textbox.change(None,
878
+ inputs=[openai_api_key_textbox],
879
+ outputs=None, _js="(api_key) => localStorage.setItem('open_api_key', api_key)")
880
 
881
+ openai_api_key_textbox.change(set_openai_api_key,
882
+ inputs=[openai_api_key_textbox],
883
+ outputs=[chain_state, express_chain_state, llm_state, embeddings_state,
884
+ qa_chain_state, memory_state])
885
+
886
+ block.load(None, inputs=None, outputs=openai_api_key_textbox, _js="()=> localStorage.getItem('open_api_key')")
887
  openai_api_key_textbox.change(None,
888
  inputs=[openai_api_key_textbox],
889
  outputs=None, _js="(api_key) => localStorage.setItem('open_api_key', api_key)")
 
896
  block.load(None, inputs=None, outputs=openai_api_key_textbox, _js="()=> localStorage.getItem('open_api_key')")
897
 
898
 
899
+ block.launch(debug=True)