deepseek-ai / deepseek-ai/DeepSeek-OCR

[Warning]: You are using a model of type deepseek_vl_v2 to instantiate a model of type DeepseekOCR. This is not supported for all configurations of models and can yield errors.

Open
#65 4 comments 7 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
23.9k
Forks
2.2k
PR merge metrics
No merged PRs in 30d

Description

I’m running this DeepSeek-OCR with Transformers inference on an NVIDIA T4 instance (CUDA 11.8 + PyTorch 2.6.0).
The model loads and runs, but I consistently get a number of warnings (see below). I’d like to confirm whether these are expected/harmless, and if there are recommended fixes or configuration changes to avoid them:
```
You are using a model of type deepseek_vl_v2 to instantiate a model of type DeepseekOCR. This is not supported for all configurations of models and can yield errors.
Some weights of DeepseekOCRForCausalLM were not initialized from the model checkpoint at cache_models and are newly initialized: ['model.vision_model.embeddings.position_ids']
You should probably TRAIN this model on a down-stream task to be able to use it for predictions and inference.
/home/ec2-user/SageMaker/.persisted_conda/deepseek-ocr/lib/python3.12/site-packages/transformers/generation/configuration_utils.py:590: UserWarning: `do_sample` is set to `False`. However, `temperature` is set to `0.0` -- this flag is only used in sample-based generation modes. You should set `do_sample=True` or unset `temperature`.
warnings.warn(
The attention mask and the pad token id were not set. As a consequence, you may observe unexpected behavior. Please pass your input's `attention_mask` to obtain reliable results.
Setting `pad_token_id` to `eos_token_id`:None for open-end generation.
The attention mask is not set and cannot be inferred from input because pad token is same as eos token. As a consequence, you may observe unexpected behavior. Please pass your input's `attention_mask` to obtain reliable results.
The `seen_tokens` attribute is deprecated and will be removed in v4.41. Use the `cache_position` model input instead.
`get_max_cache()` is deprecated for all Cache classes. Use `get_max_cache_shape()` instead. Calling `get_max_cache()` will raise error from v4.48
The attention layers in this model are transitioning from computing the RoPE embeddings internally through `position_ids` (2D tensor with the indexes of the tokens), to using externally computed `position_embeddings` (Tuple of tensors, containing cos and sin). In v4.46 `position_ids` will be removed and `position_embeddings` will be mandatory
```
* GPU: NVIDIA T4 (16GB)
* nvidia-smi reports: Driver 570.xx, CUDA 12.x (runtime)
* nvcc --version: CUDA 12.1 (toolkit)
* Torch build: cu118
* OS: Amazon Linux (SageMaker Notebook instance)
* Python: 3.12.9 (conda)
* PyTorch: 2.6.0
* Transformers: 4.46.3
* tokenizers: 0.20.3
* huggingface_hub: 0.35.3
* flash-attn: not installed (T4 / SM 7.5 → no FA2)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.