Traceback (most recent call last):
File "main.py", line 8, in <module>
response = client.chat.completions.create(
File "/home/ubuntu/.local/share/virtualenvs/Wesen-HYipQkKz/lib/python3.8/site-packages/openai/_utils/_utils.py", line 279, in wrapper
return func(*args, **kwargs)
File "/home/ubuntu/.local/share/virtualenvs/Wesen-HYipQkKz/lib/python3.8/site-packages/openai/resources/chat/completions.py", line 859, in create
return self._post(
File "/home/ubuntu/.local/share/virtualenvs/Wesen-HYipQkKz/lib/python3.8/site-packages/openai/_base_client.py", line 1283, in post
return cast(ResponseT, self.request(cast_to, opts, stream=stream, stream_cls=stream_cls))
File "/home/ubuntu/.local/share/virtualenvs/Wesen-HYipQkKz/lib/python3.8/site-packages/openai/_base_client.py", line 960, in request
return self._request(
File "/home/ubuntu/.local/share/virtualenvs/Wesen-HYipQkKz/lib/python3.8/site-packages/openai/_base_client.py", line 1064, in _request
raise self._make_status_error_from_response(err.response) from None
openai.UnprocessableEntityError: Error code: 422 - {'detail': [{'loc': ['body', 'model'], 'msg': "unexpected value; permitted: 'VILA1.5-3B', 'VILA1.5-3B-AWQ', 'VILA1.5-3B-S2', 'VILA1.5-3B-S2-AWQ', 'Llama-3-VILA1.5-8B', 'Llama-3-VILA1.5-8B-AWQ', 'VILA1.5-13B', 'VILA1.5-13B-AWQ', 'VILA1.5-40B', 'VILA1.5-40B-AWQ'", 'type': 'value_error.const', 'ctx': {'given': 'NVILA-15B', 'permitted': ['VILA1.5-3B', 'VILA1.5-3B-AWQ', 'VILA1.5-3B-S2', 'VILA1.5-3B-S2-AWQ', 'Llama-3-VILA1.5-8B', 'Llama-3-VILA1.5-8B-AWQ', 'VILA1.5-13B', 'VILA1.5-13B-AWQ', 'VILA1.5-40B', 'VILA1.5-40B-AWQ']}}]}
VILA, I have clone and build the image from this repo and try to run some example with an image, but an error has shown above.
from openai import OpenAI
client = OpenAI(
base_url="http://localhost:8200",
api_key="fake-key",
)
response = client.chat.completions.create(
messages=[
{
"role": "user",
"content": [
{"type": "text", "text": "What’s in this image?"},
{
"type": "image_url",
"image_url": {
"url": "https://blog.logomyway.com/wp-content/uploads/2022/01/NVIDIA-logo.jpg",
# Or you can pass in a base64 encoded image
# "url": "data:image/png;base64,<base64_encoded_image>",
},
},
],
}
],
model="NVILA-15B",
)
print(response.choices[0].message.content)
This is the python code to run the example.