Spaces:
Build error
Build error
Update models/gpt_model.py
Browse files- models/gpt_model.py +4 -1
models/gpt_model.py
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
|
|
| 1 |
import openai
|
| 2 |
|
| 3 |
-
|
|
|
|
|
|
|
| 4 |
|
| 5 |
class ImageToText:
|
| 6 |
def __init__(self, api_key, gpt_version="gpt-3.5-turbo"):
|
|
|
|
| 1 |
+
import os
|
| 2 |
import openai
|
| 3 |
|
| 4 |
+
openai_api = os.getenv("OPENAI_API","")
|
| 5 |
+
if openai_api:
|
| 6 |
+
openai.api_base = openai_api
|
| 7 |
|
| 8 |
class ImageToText:
|
| 9 |
def __init__(self, api_key, gpt_version="gpt-3.5-turbo"):
|