Anyone else having very slow responses or no response at all from gpt-4-vision-preview? I got it working the first few times, but it seems to be hanging now, no response even after 5 minutes.
const base64String = await downloadImage("https://upload.wikimedia.org/wikipedia/commons/thumb/d/dd/Gfp-wisconsin-madison-the-nature-boardwalk.jpg/2560px-Gfp-wisconsin-madison-the-nature-boardwalk.jpg")
const response = await openai.chat.completions.create({
model: "gpt-4-vision-preview",
messages: [
{
role: "user",
content: [
{ type: "text", text: `What's in this image? ` },
{
type: "image_url",
image_url: {
"url": `data:image/jpeg;base64,${base64String}`,
// 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"
},
},
],
},
],
max_tokens: 4096,
});
async function downloadImage(url: string): Promise<string> {
const response = await fetch(url);
const buffer = await response.arrayBuffer();
const base64data = Buffer.from(buffer).toString('base64');
return base64data;
}
Running in NodeJS