VILA
VILA copied to clipboard
How to change openai inference call to docker for video?
How can I modify this to be used for video querying and description??
client = OpenAI(
base_url="http://localhost:8000",
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>",
},
},
],
}
],
max_tokens=300,
model="VILA1.5-3B",
# You can pass in extra parameters as follows
extra_body={"num_beams": 1, "use_cache": False},
)
print(response.choices[0].message.content)```