Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -38,11 +38,18 @@ def process_image(image_input):
|
|
| 38 |
base64_image = base64.b64encode(image_input.read()).decode("utf-8")
|
| 39 |
response = client.chat.completions.create(
|
| 40 |
model=MODEL,
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 44 |
)
|
| 45 |
-
st.markdown(response.
|
| 46 |
|
| 47 |
def process_audio(audio_input):
|
| 48 |
if audio_input:
|
|
|
|
| 38 |
base64_image = base64.b64encode(image_input.read()).decode("utf-8")
|
| 39 |
response = client.chat.completions.create(
|
| 40 |
model=MODEL,
|
| 41 |
+
messages=[
|
| 42 |
+
{"role": "system", "content": "You are a helpful assistant that responds in Markdown."},
|
| 43 |
+
{"role": "user", "content": [
|
| 44 |
+
{"type": "text", "text": "Help me understand what is in this picture and list ten facts as markdown outline with appropriate emojis that describes what you see."},
|
| 45 |
+
{"type": "image_url", "image_url": {
|
| 46 |
+
"url": f"data:image/png;base64,{base64_image}"}
|
| 47 |
+
}
|
| 48 |
+
]}
|
| 49 |
+
],
|
| 50 |
+
temperature=0.0,
|
| 51 |
)
|
| 52 |
+
st.markdown(response.message.content)
|
| 53 |
|
| 54 |
def process_audio(audio_input):
|
| 55 |
if audio_input:
|