Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,8 +1,3 @@
|
|
| 1 |
-
"""
|
| 2 |
-
OCR Application with Multiple Models including DeepSeek OCR
|
| 3 |
-
Merged version with working DeepSeek implementation
|
| 4 |
-
"""
|
| 5 |
-
|
| 6 |
import os
|
| 7 |
import time
|
| 8 |
import torch
|
|
@@ -293,7 +288,6 @@ def generate_image(model_name: str, text: str, image: Image.Image,
|
|
| 293 |
top_p: Nucleus sampling parameter
|
| 294 |
top_k: Top-k sampling parameter
|
| 295 |
repetition_penalty: Penalty for repeating tokens
|
| 296 |
-
deepseek_preset: Preset for DeepSeek model
|
| 297 |
|
| 298 |
Yields:
|
| 299 |
tuple: (raw_text, markdown_text)
|
|
@@ -516,14 +510,6 @@ if __name__ == "__main__":
|
|
| 516 |
- **Nanonets-OCR2-3B**: Nanonets OCR model
|
| 517 |
- **Chandra-OCR**: Datalab OCR model
|
| 518 |
- **Dots.OCR**: Stranger Vision OCR model
|
| 519 |
-
- **DeepSeek-OCR**: DeepSeek AI's OCR model (uses native inference method)
|
| 520 |
-
|
| 521 |
-
### DeepSeek-OCR Presets:
|
| 522 |
-
- **Gundam** (Recommended): Balanced performance with crop mode
|
| 523 |
-
- **Base**: Standard quality without cropping
|
| 524 |
-
- **Large**: Highest quality for complex documents
|
| 525 |
-
- **Small**: Faster processing, good for simple text
|
| 526 |
-
- **Tiny**: Fastest, suitable for clear printed text
|
| 527 |
""")
|
| 528 |
|
| 529 |
# Event handler to show/hide DeepSeek preset based on model selection
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
import os
|
| 2 |
import time
|
| 3 |
import torch
|
|
|
|
| 288 |
top_p: Nucleus sampling parameter
|
| 289 |
top_k: Top-k sampling parameter
|
| 290 |
repetition_penalty: Penalty for repeating tokens
|
|
|
|
| 291 |
|
| 292 |
Yields:
|
| 293 |
tuple: (raw_text, markdown_text)
|
|
|
|
| 510 |
- **Nanonets-OCR2-3B**: Nanonets OCR model
|
| 511 |
- **Chandra-OCR**: Datalab OCR model
|
| 512 |
- **Dots.OCR**: Stranger Vision OCR model
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 513 |
""")
|
| 514 |
|
| 515 |
# Event handler to show/hide DeepSeek preset based on model selection
|