Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -18,10 +18,10 @@ key=os.getenv("KEY")
|
|
18 |
model=os.getenv("MODEL")
|
19 |
|
20 |
|
21 |
-
OPENAI_API_KEY =
|
22 |
sync_client = OpenAI(
|
23 |
-
base_url=
|
24 |
-
api_key=
|
25 |
)
|
26 |
|
27 |
# Ensuring pydub can locate ffmpeg
|
@@ -152,7 +152,7 @@ def chatbot_conversation(audio_file_path, history):
|
|
152 |
# Stream partial responses
|
153 |
try:
|
154 |
for message in sync_client.chat.completions.create(
|
155 |
-
model=
|
156 |
messages=messages,
|
157 |
stream=True,
|
158 |
max_tokens=1024,
|
|
|
18 |
model=os.getenv("MODEL")
|
19 |
|
20 |
|
21 |
+
OPENAI_API_KEY = secret
|
22 |
sync_client = OpenAI(
|
23 |
+
base_url=url,
|
24 |
+
api_key=key
|
25 |
)
|
26 |
|
27 |
# Ensuring pydub can locate ffmpeg
|
|
|
152 |
# Stream partial responses
|
153 |
try:
|
154 |
for message in sync_client.chat.completions.create(
|
155 |
+
model=model,
|
156 |
messages=messages,
|
157 |
stream=True,
|
158 |
max_tokens=1024,
|