Skip to content

Commit

Permalink
Update 4-AI_image_multimodal_location_GPT.R
Browse files Browse the repository at this point in the history
Correction of error on text generation when filesize is bigger than 4Mb (Azure's limit)
  • Loading branch information
fevieira27 authored Jan 10, 2024
1 parent ccdbbdc commit 09abf53
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion 4-AI_image_multimodal_location_GPT.R
Original file line number Diff line number Diff line change
Expand Up @@ -724,7 +724,12 @@ if (file.size(image_path)>4150000){ # needed?
}

# Describe the image using Azure AI:
text <- analyze(vis, image_path, domain = "landmarks", feature_types = "description")$description$captions$text
if (file.size(image_path)>4150000){ # needed?
text <- analyze(vis, raw_vector, domain = "landmarks", feature_types = "description")$description$captions$text
} else {
text <- analyze(vis, image_path, domain = "landmarks", feature_types = "description")$description$captions$text
}


# Define a string for the Bing Chat prompt, that will generate the text for the social media post. Feel free to change this to your liking
str <- ""
Expand Down

0 comments on commit 09abf53

Please sign in to comment.