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