Bina 0.1 — بینا ۰.۱

The merged BF16 release of the Persian OCR LoRA checkpoint at step 8,000 from Reza2kn/surya-ocr-2-persian-lora-7m, based on datalab-to/surya-ocr-2.

This repository is the immutable BF16 transcription baseline for Bina 0.1. Quantized/runtime-specific derivatives should be compared against this model before being described as parity-preserving.

Quick start (English)

Bina 0.1 is compatible with the Surya OCR 2 inference package. The easiest supported setup is Linux (or WSL2) with an NVIDIA GPU.

1. Install the prerequisites

Then install or upgrade Surya:

python -m pip install -U "surya-ocr>=0.20.0"

2. Run OCR

Replace document.pdf with an image, a PDF, or a folder containing images/PDFs:

export SURYA_MODEL_CHECKPOINT=Reza2kn/Bina-0.1
export SURYA_INFERENCE_BACKEND=vllm

surya_ocr ./document.pdf --output_dir ./bina-output

On the first run, Surya downloads the model and starts a vLLM server in Docker, so startup can take a few minutes. For the example above, the OCR result is written to ./bina-output/document/results.json. Each page contains ordered blocks with recognized HTML/text, labels, confidence scores, and bounding boxes.

Useful options:

# Process only pages 0 through 2
surya_ocr ./document.pdf --page_range 0-2 --output_dir ./bina-output

# Also save annotated page images
surya_ocr ./document.pdf --images --output_dir ./bina-output

Python example

Set the environment variables before importing surya:

import os

os.environ["SURYA_MODEL_CHECKPOINT"] = "Reza2kn/Bina-0.1"
os.environ["SURYA_INFERENCE_BACKEND"] = "vllm"

from PIL import Image
from surya.inference import SuryaInferenceManager
from surya.recognition import RecognitionPredictor

image = Image.open("page.jpg").convert("RGB")
manager = SuryaInferenceManager()
predictor = RecognitionPredictor(manager)
result = predictor([image])[0]

for block in result.blocks:
    print(block.html)

CPU and Apple Silicon: this repository contains BF16 weights, not a GGUF build. The automatic llama.cpp path therefore cannot run Bina 0.1 directly; use the NVIDIA/vLLM setup above or a Bina-specific GGUF conversion.

راه‌اندازی سریع (فارسی)

بینا ۰.۱ با بستهٔ استنتاج Surya OCR 2 سازگار است. ساده‌ترین روش پشتیبانی‌شده، استفاده از لینوکس (یا WSL2) و کارت گرافیک NVIDIA است.

۱. نصب پیش‌نیازها

سپس Surya را نصب یا به‌روز کنید:

python -m pip install -U "surya-ocr>=0.20.0"

۲. اجرای OCR

به‌جای document.pdf می‌توانید مسیر یک تصویر، فایل PDF یا پوشه‌ای از تصاویر/PDFها را قرار دهید:

export SURYA_MODEL_CHECKPOINT=Reza2kn/Bina-0.1
export SURYA_INFERENCE_BACKEND=vllm

surya_ocr ./document.pdf --output_dir ./bina-output

در اجرای اول، Surya مدل را دانلود و سرور vLLM را در Docker راه‌اندازی می‌کند؛ بنابراین شروع کار ممکن است چند دقیقه طول بکشد. در مثال بالا، نتیجه در مسیر ./bina-output/document/results.json ذخیره می‌شود. خروجی هر صفحه شامل بلوک‌های مرتب‌شده، متن/HTML تشخیص‌داده‌شده، نوع بلوک، میزان اطمینان و مختصات کادرها است.

چند گزینهٔ کاربردی:

# فقط پردازش صفحه‌های ۰ تا ۲
surya_ocr ./document.pdf --page_range 0-2 --output_dir ./bina-output

# ذخیرهٔ تصویر صفحه‌ها همراه با کادرهای تشخیص‌داده‌شده
surya_ocr ./document.pdf --images --output_dir ./bina-output

نمونهٔ پایتون

متغیرهای محیطی را پیش از import کردن surya تنظیم کنید:

import os

os.environ["SURYA_MODEL_CHECKPOINT"] = "Reza2kn/Bina-0.1"
os.environ["SURYA_INFERENCE_BACKEND"] = "vllm"

from PIL import Image
from surya.inference import SuryaInferenceManager
from surya.recognition import RecognitionPredictor

image = Image.open("page.jpg").convert("RGB")
manager = SuryaInferenceManager()
predictor = RecognitionPredictor(manager)
result = predictor([image])[0]

for block in result.blocks:
    print(block.html)

CPU و Apple Silicon: این مخزن شامل وزن‌های BF16 است و فایل GGUF ندارد؛ بنابراین مسیر خودکار llama.cpp نمی‌تواند بینا ۰.۱ را مستقیماً اجرا کند. از روش NVIDIA/vLLM بالا یا یک تبدیل GGUF مخصوص بینا استفاده کنید.

Provenance

  • LoRA checkpoint: checkpoints/checkpoint-step-0008000
  • Merged artifact path on the release host: /home/rezo/triple-threat/hf-cache/surya-step8000-merged
  • Architecture: Qwen3_5ForConditionalGeneration
  • Weight dtype: BF16
  • model.safetensors SHA-256: 2193be4ef3d2366438121a15b7a1dea2bb85b24f83145e5a39bfa1f387891ada
  • config.json SHA-256: e0de22be177070f206106c184d062176fcda591d9114068c42489ffc550488de

Intended use

Persian document OCR. The model is currently served as بینا ۰.۱ on PersianVLM.com. Use deterministic decoding for baseline comparisons.

License

This release follows the upstream Surya OCR 2 OpenRAIL license. Review the upstream license before redistribution or deployment.

Downloads last month
936
Safetensors
Model size
0.7B params
Tensor type
BF16
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for Reza2kn/Bina-0.1

Finetuned
(4)
this model
Finetunes
1 model

Space using Reza2kn/Bina-0.1 1