Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running vision with video sample throws an error #114

Open
prashant-bhandari opened this issue Jul 6, 2024 · 0 comments
Open

Running vision with video sample throws an error #114

prashant-bhandari opened this issue Jul 6, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@prashant-bhandari
Copy link

Operating System

Windows

Version Information

While running the sample https://github.com/Azure-Samples/azureai-samples/blob/main/scenarios/GPT-4V/video/video_chatcompletions_example_restapi.ipynb with own video throws an error:
{"choices":[{"messages":[{"delta":{"role":"tool", "content": "{"ErrorMessage":The 'video' enhancement requires a data source of type 'AzureComputerVisionVideoIndex'.,"ErrorCode": 400}"}}]}]}

This is how my payload looks:
payload = {
"model": "gpt-4-vision-preview",
"enhancements": {
"video": {
"enabled": True
}
},
"dataSources": [
{
"type": "AzureComputerVisionVideoIndex",
"parameters": {
"computerVisionBaseUrl": f"{vision_api.get('endpoint')}computervision",
"computerVisionApiKey": vision_api.get("key"),
"indexName": video_index.get("video_index_name"),
"videoUrls": [video_index.get("video_SAS_url")],
},
}
],
"messages": messages,
"max_tokens": 800,
"stream": True
}

Few changes were made to the api_url from this documentation https://learn.microsoft.com/en-us/azure/ai-services/openai/how-to/gpt-with-vision?tabs=rest%2Csystem-assigned%2Cresource

Steps to reproduce

Run the above sample with a new video

Expected behavior

suppose to get output like this:
{
"id": "chatcmpl-8V4J2cFo7TWO7rIfs47XuDzTKvbct",
"object": "chat.completion",
"created": 1702415412,
"model": "gpt-4",
"choices":
[
{
"finish_reason":"stop",
"index": 0,
"message":
{
"role": "assistant",
"content": "The advertisement video opens with a blurred background that suggests a serene and aesthetically pleasing environment, possibly a workspace with a nature view. As the video progresses, a series of frames showcase a digital interface with search bars and prompts like "Inspire new ideas," "Research a topic," and "Organize my plans," suggesting features of a software or application designed to assist with productivity and creativity.\n\nThe color palette is soft and varied, featuring pastel blues, pinks, and purples, creating a calm and inviting atmosphere. The backgrounds of some frames are adorned with abstract, organically shaped elements and animations, adding to the sense of innovation and modernity.\n\nMidway through the video, the focus shifts to what appears to be a browser or software interface with the phrase "Screens simulated, subject to change; feature availability and timing may vary," indicating the product is in development and that the visuals are illustrative of its capabilities.\n\nThe use of text prompts continues with "Help me relax," followed by a demonstration of a 'dark mode' feature, providing a glimpse into the software's versatility and user-friendly design.\n\nThe video concludes by revealing the product name, "Copilot," and positioning it as "Your everyday AI companion," implying the use of artificial intelligence to enhance daily tasks. The final frames feature the Microsoft logo, associating the product with the well-known technology company.\n\nIn summary, the advertisement video is for a Microsoft product named "Copilot," which seems to be an AI-powered software tool aimed at improving productivity, creativity, and organization for its users. The video conveys a message of innovation, ease, and support in daily digital interactions through a visually appealing and calming presentation."
}
}
],
"usage":
{
"prompt_tokens": 2068,
"completion_tokens": 341,
"total_tokens": 2409
}
}

Actual behavior

Gets back this
{"choices":[{"messages":[{"delta":{"role":"tool", "content": "{"ErrorMessage":The 'video' enhancement requires a data source of type 'AzureComputerVisionVideoIndex'.,"ErrorCode": 400}"}}]}]}

Addition information

No response

@prashant-bhandari prashant-bhandari added the bug Something isn't working label Jul 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant