Spaces:
Runtime error
Runtime error
Commit
·
fc26409
1
Parent(s):
f6d4bed
Update app.py
Browse files
app.py
CHANGED
@@ -14,8 +14,8 @@ def set_openai_api_key(api_key: str):
|
|
14 |
"""Set the api key and return chain.
|
15 |
If no api_key, then None is returned.
|
16 |
"""
|
17 |
-
if
|
18 |
-
os.environ["OPENAI_API_KEY"] =
|
19 |
chain = get_chain(vectorstore)
|
20 |
os.environ["OPENAI_API_KEY"] = ""
|
21 |
return chain
|
|
|
14 |
"""Set the api key and return chain.
|
15 |
If no api_key, then None is returned.
|
16 |
"""
|
17 |
+
if api_key:
|
18 |
+
os.environ["OPENAI_API_KEY"] = os.environ["OPENAI_API_KEY"]
|
19 |
chain = get_chain(vectorstore)
|
20 |
os.environ["OPENAI_API_KEY"] = ""
|
21 |
return chain
|