-
Notifications
You must be signed in to change notification settings - Fork 0
/
test_openai_llava.py
32 lines (31 loc) · 1023 Bytes
/
test_openai_llava.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import openai
client = openai.Client(api_key="EMPTY", base_url="https://127.0.0.1:10000/v1")
response = client.chat.completions.create(
model="default",
messages=[
{
"role": "user",
"content": [
{
"type": "image_url",
"image_url": {
"url": "https://github.com/sgl-project/sglang/blob/main/test/lang/example_image.png?raw=true"
},
},
{
"type": "image_url",
"image_url": {
"url": "https://github.com/sgl-project/sglang/blob/main/test/lang/example_image.png?raw=true"
},
},
{
"type": "text",
"text": "Describe this image in a very short sentence.",
},
],
},
],
temperature=0,
modalities=["multi-image"],
)
print(response.choices[0].message.content)