Commit 74b3bcd
committed
feat: Add DeepSeek-OCR integration with Apple Silicon MPS support
- Add DeepSeekOcrModel with automatic device detection (CUDA/MPS)
- CUDA uses bfloat16 precision and flash_attention_2 (optimal)
- MPS uses float16 precision and eager attention (Apple Silicon fallback)
- Auto-switch to MPS-compatible model (Dogacel/DeepSeek-OCR-Metal-MPS)
- Add PyTorch 2.7.0+ version validation for MPS support
- Add clear error messages for device/version incompatibilities
- Update test_e2e_ocr_conversion.py with CUDA/MPS device support
- Add manual test script for DeepSeek-OCR validation
- Update documentation with MPS support information
Note: MPS support requires PyTorch 2.7.0+ and is currently blocked by
a transformers version incompatibility in the community MPS model.
See: https://huggingface.co/Dogacel/DeepSeek-OCR-Metal-MPS/discussions
Signed-off-by: Rafael T. C. Soares <[email protected]>1 parent f80c903 commit 74b3bcd
File tree
8 files changed
+1443
-4
lines changed- docling
- datamodel
- models
- plugins
- docs/getting_started
- tests
8 files changed
+1443
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
203 | 203 | | |
204 | 204 | | |
205 | 205 | | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
206 | 269 | | |
207 | 270 | | |
208 | 271 | | |
| |||
273 | 336 | | |
274 | 337 | | |
275 | 338 | | |
| 339 | + | |
276 | 340 | | |
277 | 341 | | |
278 | 342 | | |
| |||
0 commit comments