Tycohs commited on
Commit
f05abed
·
1 Parent(s): d3bfd89

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -114,7 +114,8 @@ with gr.Blocks() as demo:
114
 
115
  def checkapiinput(apikey):
116
  if apikey != "" and apikey is not None and len(apikey) >=25 and len(apikey) <= 130:
117
- openai.api_key = apikey
 
118
  return gr.update(visible=True), gr.update(visible=False), gr.update(visible=True), gr.update(visible=True)
119
  else:
120
  return gr.update(visible=False), gr.update(visible=True), gr.update(value="", placeholder="Use a valid API key"), gr.update(visible=False)
 
114
 
115
  def checkapiinput(apikey):
116
  if apikey != "" and apikey is not None and len(apikey) >=25 and len(apikey) <= 130:
117
+ client.api_key = apikey
118
+ #openai.api_key = apikey
119
  return gr.update(visible=True), gr.update(visible=False), gr.update(visible=True), gr.update(visible=True)
120
  else:
121
  return gr.update(visible=False), gr.update(visible=True), gr.update(value="", placeholder="Use a valid API key"), gr.update(visible=False)