Skip to content

Conversation

@majunpo
Copy link

@majunpo majunpo commented Dec 24, 2025

What does this PR do?

This PR fixes an AttributeError in fixed_sub_image_list when running
non-vision models such as BertEmbeddingModel.

Previously, the function assumed model.config always exists, which
causes:
AttributeError: 'BertEmbeddingModel' object has no attribute 'config'

What is changed?

  • Add a defensive check using hasattr(model, "config")
  • Only apply the DeepSeek OCR specific logic when model.config.model_type == "deepseek_ocr"

Impact

  • No behavior change for deepseek_ocr models
  • Improves robustness for embedding / non-vision models
  • Safe for existing HPU inference paths

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant