Spaces:
Sleeping
Sleeping
Alfie Grace
commited on
Commit
·
684ee5c
1
Parent(s):
9d48af9
Removed hardcoded OpenAI API key
Browse files
app.py
CHANGED
@@ -265,8 +265,7 @@ def set_openai_api_key(api_key):
|
|
265 |
If no api_key, then None is returned.
|
266 |
"""
|
267 |
if api_key and api_key.startswith("sk-") and len(api_key) > 50:
|
268 |
-
|
269 |
-
os.environ["OPENAI_API_KEY"] = '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'
|
270 |
print("\n\n ++++++++++++++ Setting OpenAI API key ++++++++++++++ \n\n")
|
271 |
print(str(datetime.datetime.now()) + ": Before OpenAI, OPENAI_API_KEY length: " + str(
|
272 |
len(os.environ["OPENAI_API_KEY"])))
|
|
|
265 |
If no api_key, then None is returned.
|
266 |
"""
|
267 |
if api_key and api_key.startswith("sk-") and len(api_key) > 50:
|
268 |
+
os.environ["OPENAI_API_KEY"] = api_key
|
|
|
269 |
print("\n\n ++++++++++++++ Setting OpenAI API key ++++++++++++++ \n\n")
|
270 |
print(str(datetime.datetime.now()) + ": Before OpenAI, OPENAI_API_KEY length: " + str(
|
271 |
len(os.environ["OPENAI_API_KEY"])))
|