fix
Browse files
app.py
CHANGED
|
@@ -3,7 +3,10 @@ import openai
|
|
| 3 |
|
| 4 |
# The first line contains the OpenAI key, while the second line provides the OpenAI URL, which is useful when the OpenAI server is hidden behind a proxy server.
|
| 5 |
# eg. first line "sk-xxxxxxxxxx", second line "http://PROXY-URL"
|
| 6 |
-
|
|
|
|
|
|
|
|
|
|
| 7 |
api_key_from_config = ""
|
| 8 |
if len(config) > 0 and len(config[0].strip()) > 0:
|
| 9 |
api_key_from_config = config[0].strip()
|
|
|
|
| 3 |
|
| 4 |
# The first line contains the OpenAI key, while the second line provides the OpenAI URL, which is useful when the OpenAI server is hidden behind a proxy server.
|
| 5 |
# eg. first line "sk-xxxxxxxxxx", second line "http://PROXY-URL"
|
| 6 |
+
if os.path.isfile('config'):
|
| 7 |
+
config = open("config").readlines()
|
| 8 |
+
else:
|
| 9 |
+
config = ""
|
| 10 |
api_key_from_config = ""
|
| 11 |
if len(config) > 0 and len(config[0].strip()) > 0:
|
| 12 |
api_key_from_config = config[0].strip()
|