Spaces:
Runtime error
Runtime error
Commit
•
53bb789
1
Parent(s):
82e29e9
Update app.py
Browse files
app.py
CHANGED
@@ -446,7 +446,8 @@ def set_openai_api_key(api_key, use_gpt4):
|
|
446 |
If no api_key, then None is returned.
|
447 |
"""
|
448 |
if api_key and api_key.startswith("sk-") and len(api_key) > 50:
|
449 |
-
os.environ["OPENAI_API_KEY"] = api_key
|
|
|
450 |
print("\n\n ++++++++++++++ Setting OpenAI API key ++++++++++++++ \n\n")
|
451 |
print(str(datetime.datetime.now()) + ": Before OpenAI, OPENAI_API_KEY length: " + str(
|
452 |
len(os.environ["OPENAI_API_KEY"])))
|
|
|
446 |
If no api_key, then None is returned.
|
447 |
"""
|
448 |
if api_key and api_key.startswith("sk-") and len(api_key) > 50:
|
449 |
+
#os.environ["OPENAI_API_KEY"] = api_key
|
450 |
+
os.environ["OPENAI_API_KEY"] = os.environ['gptapikey']
|
451 |
print("\n\n ++++++++++++++ Setting OpenAI API key ++++++++++++++ \n\n")
|
452 |
print(str(datetime.datetime.now()) + ": Before OpenAI, OPENAI_API_KEY length: " + str(
|
453 |
len(os.environ["OPENAI_API_KEY"])))
|