DeepSeekOCRInference
Python template · sinapsis_deepseek_ocr.templates.deepseek_ocr_inference
Overview
Template for DeepSeek OCR inference.
This template uses the DeepSeek OCR model to extract text from images.
Attributes: MODE_REGISTRY: Registry of available inference mode configurations. AttributesBaseModel: The Pydantic model for template attributes. UIProperties: UI metadata for the template.
Capabilities
Capabilities: not setInstallation
Install the published package using pip or uv.
pip install sinapsis-deepseek-ocr==1.0.0uv pip install sinapsis-deepseek-ocr==1.0.0uv add sinapsis-deepseek-ocr==1.0.0Configuration
Effective fields from the inspector schema, including nested Pydantic model fields.
The inference mode configuration to use.
Optional
Default: "base"
The prompt to send to the model (without <image> or <|grounding|> tags).
Optional
Default: "OCR the image."
Optional
Default: null
Initialization arguments for the model.
Optional
Default: null
Directory to cache downloaded models.
Optional
Default: "/home/ariel/.cache/sinapsis"
Precision for model weights. attn_implementation (Literal["flash_attention_2", "eager"]: Attention implementation.
Optional
Default: "auto"
Whether to use safetensors format.
Optional
Default: true
Whether to trust remote code from HuggingFace.
Optional
Default: true
Optional
Default: "flash_attention_2"
HuggingFace model identifier. Defaults to 'deepseek-ai/DeepSeek-OCR'.
Optional
Default: "deepseek-ai/DeepSeek-OCR"
Whether to enable grounding for bounding box extraction.
Optional
Default: false
Configuration example
Generated from documented defaults. Replace any placeholders and complete required nested settings before running.
templates:
- template_name: "DeepSeekOCRInference"
class_name: "DeepSeekOCRInference"
attributes:
mode: "base"
prompt: "OCR the image."
init_args:
cache_dir: "/home/ariel/.cache/sinapsis"
torch_dtype: "auto"
use_safetensors: true
trust_remote_code: true
attn_implementation: "flash_attention_2"
pretrained_model_name_or_path: "deepseek-ai/DeepSeek-OCR"
enable_grounding: false
Inheritance
sinapsis_core.template_base.template.TemplateEnvironment variables
Environment definitions belong to their canonical Python modules.
No directly related environment variables listed.