Spaces:
Runtime error
Runtime error
Update app.py
Browse files
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 |
-
|
|
|
|
| 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)
|