Quantized version of vikhyatk/moondream2 for efficient browser deployment with Transformers.js.
Modellquelle
Quellenauszug
Quantized version of vikhyatk/moondream2 for efficient browser deployment with Transformers.js.
Quellen
1 QuelleVerifiziert 17. Sept.
Modellartefakte
4 Artefakteonnx/decoder_model_merged_q4.onnx
onnx · 786 MB · SHA-256 6c6c986cb277…1273 · Hugging Face
Herunterladenonnx/decoder_model_merged_q4f16.onnx
onnx · 707 MB · SHA-256 614bcbfdf03d…9274 · Hugging Face
HerunterladenQuellenauszüge
2 Auszügeonnx/embed_tokens_q4.onnx
onnx · 400 MB · SHA-256 e83c0024e778…67ef · Hugging Face
--- license: apache-2.0 tags: - vision - image-to-text - onnx - quantized - transformers.js - moondream base_model: vikhyatk/moondream2 pipeline_tag: image-to-text library_name: transformers.js --- # Moondream2 Q4 ONNX Quantized version of [vikhyatk/moondream2](https://huggingface.co/vikhyatk/moondream2) for efficient browser deployment with Transformers.js. Based on [Xenova/moondream2](https://huggingface.co/Xenova/moondream2) ONNX conversion. ## Features - INT4/Q4 quantization for ~75% size reduction - Optimized for WebGPU inference - Compatible with @huggingface/transformers ## Model Size - Original FP16: ~3.8 GB - This Q4 version: ~1.5 GB (60% reduction) ## Usage with Transformers.js ```javascript import { AutoProcessor, AutoTokenizer, Moondream1ForConditionalGeneration, RawImage, } from '@huggingface/transformers'; const model_id = 'YOUR_USERNAME/moondream2-q4-onnx'; const processor = await AutoProcessor.from_pretrained(model_id); const tokenizer = await AutoTokenizer.from_pretrained(model_id); const model = await Moondream1ForConditionalGeneration.from_pretrained(model_id, { dtype: 'q4', device: 'webgpu', }); const image = await RawImage.fromURL('your-image-url'); const text = '<image>\n\nQuestion: Describe this image\n\nAnswer:'; const textInputs = tokenizer(text); const visionInputs = await processor(image); const output = await model.generate({ ...textInputs, ...visionInputs, max_new_tokens: 256, }); const result = tokenizer.batch_decode(output, { skip_special_tokens: true }); console.log(result[0]); ``` ## License Apache 2.0 (same as base model)
Source context: 41 downloads · 1 likes · Pipeline image-to-text · Library transformers.js · Repo Nagafi/moondream2-q4-onnx