updates gpt4-v tokenizer for previous Risu change

This commit is contained in:
nai-degen
2024-01-27 13:35:46 -06:00
parent c9791acd85
commit 3f2f30e605
+1 -1
View File
@@ -54,7 +54,7 @@ export async function getTokenCount(
for (const item of value) {
if (item.type === "text") {
textContent += item.text;
} else if (item.type === "image_url") {
} else if (["image", "image_url"].includes(item.type)) {
const { url, detail } = item.image_url;
const cost = await getGpt4VisionTokenCost(url, detail);
numTokens += cost ?? 0;