| // Janus-Pro-7B WebGPU Usage | |
| import { AutoProcessor, AutoModelForCausalLM } from "@huggingface/transformers"; | |
| async function loadJanus() { | |
| const processor = await AutoProcessor.from_pretrained("./janus-pro-7b-webgpu"); | |
| const model = await AutoModelForCausalLM.from_pretrained("./janus-pro-7b-webgpu", { | |
| device: "webgpu", | |
| dtype: "q4f16" | |
| }); | |
| return { model, processor }; | |
| } | |
| export { loadJanus }; |