Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -89,10 +89,10 @@ if uploaded_file is not None and analyze_button:
|
|
89 |
"content": [
|
90 |
{"type": "text", "text": prompt_text},
|
91 |
{
|
92 |
-
"type": "
|
93 |
-
"
|
94 |
-
#
|
95 |
-
"
|
96 |
},
|
97 |
},
|
98 |
],
|
@@ -105,11 +105,11 @@ if uploaded_file is not None and analyze_button:
|
|
105 |
completion = client.chat.completions.create(
|
106 |
model="meta-llama/Llama-3.2-11B-Vision-Instruct",
|
107 |
messages=messages,
|
108 |
-
max_tokens=
|
109 |
)
|
110 |
|
111 |
# Extract the assistant's response
|
112 |
-
assistant_response = completion.
|
113 |
|
114 |
# Display the response
|
115 |
st.markdown(assistant_response)
|
|
|
89 |
"content": [
|
90 |
{"type": "text", "text": prompt_text},
|
91 |
{
|
92 |
+
"type": "image_url",
|
93 |
+
"image_url": {
|
94 |
+
# Since we have the image in base64, we need to use a data URL
|
95 |
+
"url": f"data:image/jpeg;base64,{base64_image}"
|
96 |
},
|
97 |
},
|
98 |
],
|
|
|
105 |
completion = client.chat.completions.create(
|
106 |
model="meta-llama/Llama-3.2-11B-Vision-Instruct",
|
107 |
messages=messages,
|
108 |
+
max_tokens=500 # Adjusted to match the template
|
109 |
)
|
110 |
|
111 |
# Extract the assistant's response
|
112 |
+
assistant_response = completion.choices[0].message['content']
|
113 |
|
114 |
# Display the response
|
115 |
st.markdown(assistant_response)
|