Update app.py
Browse files
app.py
CHANGED
|
@@ -400,13 +400,15 @@ def run_chat_inference(history, message, state):
|
|
| 400 |
api_messages.pop(idx - removed)
|
| 401 |
removed += 1
|
| 402 |
gr.Warning(f"Too many images provided; keeping the latest {MAX_IMAGE_MESSAGES} and dropped {removed} older image message(s).")
|
| 403 |
-
|
|
|
|
| 404 |
stream = openai_client.chat.completions.create(
|
| 405 |
model=model_name,
|
| 406 |
messages=api_messages,
|
| 407 |
temperature=temperature,
|
| 408 |
stream=True
|
| 409 |
)
|
|
|
|
| 410 |
except Exception as e:
|
| 411 |
log_error(f"Error:\n\t{e}\n\tInference failed for model {model_name} and endpoint {model_config['base_url']}")
|
| 412 |
error = str(e)
|
|
|
|
| 400 |
api_messages.pop(idx - removed)
|
| 401 |
removed += 1
|
| 402 |
gr.Warning(f"Too many images provided; keeping the latest {MAX_IMAGE_MESSAGES} and dropped {removed} older image message(s).")
|
| 403 |
+
print('model', model_name)
|
| 404 |
+
print('messages', api_messages)
|
| 405 |
stream = openai_client.chat.completions.create(
|
| 406 |
model=model_name,
|
| 407 |
messages=api_messages,
|
| 408 |
temperature=temperature,
|
| 409 |
stream=True
|
| 410 |
)
|
| 411 |
+
print('stream', stream)
|
| 412 |
except Exception as e:
|
| 413 |
log_error(f"Error:\n\t{e}\n\tInference failed for model {model_name} and endpoint {model_config['base_url']}")
|
| 414 |
error = str(e)
|