Guiyom commited on
Commit
697d123
·
1 Parent(s): 2b71fc1

Update app.py

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