Update app.py
Browse files
app.py
CHANGED
|
@@ -1,3 +1,16 @@
|
|
| 1 |
-
import
|
| 2 |
-
import
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import os
|
| 2 |
+
import openai
|
| 3 |
+
|
| 4 |
+
client = openai.OpenAI(
|
| 5 |
+
api_key=os.environ.get("SAMBANOVA_API_KEY"),
|
| 6 |
+
base_url="https://api.sambanova.ai/v1",
|
| 7 |
+
)
|
| 8 |
+
|
| 9 |
+
response = client.chat.completions.create(
|
| 10 |
+
model='Llama-3.2-90B-Vision-Instruct',
|
| 11 |
+
messages=[{"role":"user","content":[{"type":"text","text":"What do you see in this image"},{"type":"image_url","image_url":{"url":"<image_in_base_64>"}}]}],
|
| 12 |
+
temperature = 0.1,
|
| 13 |
+
top_p = 0.1
|
| 14 |
+
)
|
| 15 |
+
|
| 16 |
+
print(response.choices[0].message.content)
|