Downloads · 30 days
48
3% of all-time downloads
Durgaram/dots.mocr-4bit
dots.mocr-4bit is a image-text-to-text model from Durgaram. Use it for the image-text-to-text task on the model card, and read the license before you ship it in a product. It is set up for transformers. The card lists the license as mit.
This repository provides a 4-bit quantized version of dots.mocr, optimized using BitsAndBytes (NF4 precision) for efficient, low-memory inference.
Downloads · 30 days
48
3% of all-time downloads
All-time downloads
1.4K
Public
Parameters
3.1B
2.3 GB on disk
Likes
1
Public
Click a slice to open those files.
.safetensors2.3 GB · 99%
How the weights are stored.
U82.7B · 85%
From the Hugging Face model README
This repository provides a 4-bit quantized version of dots.mocr, optimized using BitsAndBytes (NF4 precision) for efficient, low-memory inference.
The original model is a powerful multimodal OCR system capable of:
This version enables deployment on low-VRAM GPUs while maintaining strong performance.
⚠️ This model depends on the original dots.mocr repository.
conda create -n dots_mocr python=3.12
conda activate dots_mocr
git clone https://github.com/rednote-hilab/dots.mocr.git
cd dots.mocr
pip install -e .
pip install flash-attn==2.8.0.post2
from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig
model_id = "rednote-hilab/dots.mocr"
bnb_config = BitsAndBytesConfig(
load_in_4bit=True,
bnb_4bit_quant_type="nf4",
bnb_4bit_compute_dtype="float16",
bnb_4bit_use_double_quant=True
)
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
model_id,
quantization_config=bnb_config,
device_map="auto",
trust_remote_code=True
)
# Example usage
inputs = tokenizer("Extract text from image", return_tensors="pt").to("cuda")
outputs = model.generate(**inputs, max_new_tokens=200)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
| Parameter | Value |
|---|---|
| Precision | 4-bit |
| Quant Type | NF4 |
| Compute Dtype | float16 |
| Double Quant | Enabled |
| Library | BitsAndBytes |
rednote-hilab/dots.mocrMIT License