Image-to-Text
Transformers.js
ONNX
English
multi_modality
webgpu
multimodal
text-to-image
vision-language
janus
browser-ai
edge-ai
Instructions to use Zhare-AI/janus-pro-7b-webgpu with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers.js
How to use Zhare-AI/janus-pro-7b-webgpu with Transformers.js:
// npm i @huggingface/transformers import { pipeline } from '@huggingface/transformers'; // Allocate pipeline const pipe = await pipeline('image-to-text', 'Zhare-AI/janus-pro-7b-webgpu');
Download usage_example.js from Zhare-AI/janus-pro-7b-webgpu: direct link, hf CLI and curl.
- Browser
- Download file 426 Bytes
-
https://huggingface.co/Zhare-AI/janus-pro-7b-webgpu/resolve/main/usage_example.js
- Command line
-
hf download hf://Zhare-AI/janus-pro-7b-webgpu/usage_example.js
-
curl -L -o usage_example.js https://huggingface.co/Zhare-AI/janus-pro-7b-webgpu/resolve/main/usage_example.js
426 Bytes
| // 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 }; |