Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -28,12 +28,23 @@ def analyze(prompt, img):
|
|
| 28 |
})
|
| 29 |
|
| 30 |
try:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 31 |
completion = client.chat.completions.create(
|
| 32 |
model=MODEL,
|
| 33 |
messages=[{"role": "user", "content": msg_content}],
|
| 34 |
)
|
| 35 |
response_text = completion.choices[0].message.content
|
| 36 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 37 |
# --- Extract image if present ---
|
| 38 |
image_obj = None
|
| 39 |
msg = completion.choices[0].message
|
|
|
|
| 28 |
})
|
| 29 |
|
| 30 |
try:
|
| 31 |
+
|
| 32 |
+
# π Print user input
|
| 33 |
+
print("=== USER PROMPT ===")
|
| 34 |
+
print(prompt)
|
| 35 |
+
print("Has image?", bool(img))
|
| 36 |
+
|
| 37 |
+
|
| 38 |
completion = client.chat.completions.create(
|
| 39 |
model=MODEL,
|
| 40 |
messages=[{"role": "user", "content": msg_content}],
|
| 41 |
)
|
| 42 |
response_text = completion.choices[0].message.content
|
| 43 |
|
| 44 |
+
# π Print raw response
|
| 45 |
+
print("=== MODEL RESPONSE ===")
|
| 46 |
+
print(response_text)
|
| 47 |
+
|
| 48 |
# --- Extract image if present ---
|
| 49 |
image_obj = None
|
| 50 |
msg = completion.choices[0].message
|