How to enable Vision enhancements for Azure Open AI? #1433
-
How can we enable Vision enhancements for Azure Open AI GPT 4 Vision preview? It is suggested to enable it for enhancing the OCR - https://learn.microsoft.com/en-us/azure/ai-services/openai/how-to/gpt-with-vision#use-vision-enhancement-with-images The below parameters need to be added to the payload for "enhancements": {"ocr": {"enabled": true}, "grounding": {"enabled": false}},
"dataSources": [
{
"type": "AzureComputerVision",
"parameters": {
"endpoint": "https://<endpoint>.cognitiveservices.azure.com",
"key": "***",
},
}
] |
Beta Was this translation helpful? Give feedback.
Answered by
ishaan-jaff
Jan 13, 2024
Replies: 2 comments
-
Here's how (live on 1.17.6+): https://docs.litellm.ai/docs/providers/azure#usage---with-azure-vision-enhancements import os
from litellm import completion
os.environ["AZURE_API_KEY"] = "your-api-key"
# azure call
response = completion(
model = "azure/<your deployment name>",
messages=[
{
"role": "user",
"content": [
{
"type": "text",
"text": "What’s in this image?"
},
{
"type": "image_url",
"image_url": {
"url": "https://upload.wikimedia.org/wikipedia/commons/thumb/d/dd/Gfp-wisconsin-madison-the-nature-boardwalk.jpg/2560px-Gfp-wisconsin-madison-the-nature-boardwalk.jpg"
}
}
]
}
],
enhancements = {"ocr": {"enabled": True}, "grounding": {"enabled": True}},
dataSources = [
{
"type": "AzureComputerVision",
"parameters": {
"endpoint": "<your_computer_vision_endpoint>",
"key": "<your_computer_vision_key>",
},
}
],
) |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
ishaan-jaff
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Here's how (live on 1.17.6+): https://docs.litellm.ai/docs/providers/azure#usage---with-azure-vision-enhancements