Alfie Grace commited on
Commit
05e8fd8
·
1 Parent(s): f4830d3

Hardcoded OpenAI API key

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -265,7 +265,8 @@ def set_openai_api_key(api_key):
265
  If no api_key, then None is returned.
266
  """
267
  if api_key and api_key.startswith("sk-") and len(api_key) > 50:
268
- os.environ["OPENAI_API_KEY"] = api_key
 
269
  print("\n\n ++++++++++++++ Setting OpenAI API key ++++++++++++++ \n\n")
270
  print(str(datetime.datetime.now()) + ": Before OpenAI, OPENAI_API_KEY length: " + str(
271
  len(os.environ["OPENAI_API_KEY"])))
@@ -572,7 +573,7 @@ def update_use_embeddings(widget, state):
572
  return state
573
 
574
 
575
- with gr.Blocks(css=".gradio-container {background-color: lightgray}") as block:
576
  llm_state = gr.State()
577
  history_state = gr.State()
578
  chain_state = gr.State()
 
265
  If no api_key, then None is returned.
266
  """
267
  if api_key and api_key.startswith("sk-") and len(api_key) > 50:
268
+ # os.environ["OPENAI_API_KEY"] = api_key
269
+ os.environ["OPENAI_API_KEY"] = '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'
270
  print("\n\n ++++++++++++++ Setting OpenAI API key ++++++++++++++ \n\n")
271
  print(str(datetime.datetime.now()) + ": Before OpenAI, OPENAI_API_KEY length: " + str(
272
  len(os.environ["OPENAI_API_KEY"])))
 
573
  return state
574
 
575
 
576
+ with gr.Blocks(css=".gradio-container {background-color: black}") as block:
577
  llm_state = gr.State()
578
  history_state = gr.State()
579
  chain_state = gr.State()