darienacosta commited on
Commit
28899eb
1 Parent(s): af704bc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -579,7 +579,8 @@ class ChatWrapper:
579
  if chain:
580
  # Set OpenAI key
581
  import openai
582
- openai.api_key = api_key
 
583
  if not monologue:
584
  if use_embeddings:
585
  if inp and inp.strip() != "":
@@ -839,7 +840,7 @@ with gr.Blocks(css=".gradio-container {background-color: lightgray}") as block:
839
  with gr.Row():
840
  openai_api_key_textbox = gr.Textbox(value=os.environ['gptapikey'], placeholder="Paste your OpenAI API key (sk-...) and hit Enter",
841
  show_label=False, lines=1, type='password')
842
- openai_api_key_textbox.submit()
843
  #api_text_submit = gr.Button(value="Activate Embeddings", variant="secondary").style(full_width=False)
844
  #api_text_submit.click(update_embeddings,
845
  # inputs=[embeddings_text_box, embeddings_state, qa_chain_state],
 
579
  if chain:
580
  # Set OpenAI key
581
  import openai
582
+ #openai.api_key = api_key
583
+ openai.api_key = os.environ['gptapikey']
584
  if not monologue:
585
  if use_embeddings:
586
  if inp and inp.strip() != "":
 
840
  with gr.Row():
841
  openai_api_key_textbox = gr.Textbox(value=os.environ['gptapikey'], placeholder="Paste your OpenAI API key (sk-...) and hit Enter",
842
  show_label=False, lines=1, type='password')
843
+ #openai_api_key_textbox.submit()
844
  #api_text_submit = gr.Button(value="Activate Embeddings", variant="secondary").style(full_width=False)
845
  #api_text_submit.click(update_embeddings,
846
  # inputs=[embeddings_text_box, embeddings_state, qa_chain_state],