Created
May 5, 2025 08:45
-
-
Save thangman22/a1740da5e8a8d3daec83c2106dfc725d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { | |
FilesetResolver, | |
LlmInference, | |
} from "https://cdn.jsdelivr.net/npm/@mediapipe/tasks-genai"; | |
const genai = await FilesetResolver.forGenAiTasks( | |
"https://cdn.jsdelivr.net/npm/@mediapipe/tasks-genai@latest/wasm" | |
); | |
llmInference = await LlmInference.createFromOptions(genai, { | |
baseOptions: { | |
modelAssetPath: "/assets/gemma3-1B-it-int4.task", | |
}, | |
maxTokens: 2048 | |
}); | |
const responseText = await llmInference.generateResponse("Hello, nice to meet you"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment