Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -10,7 +10,7 @@ from transformers import (
|
|
| 10 |
Qwen2_5_VLForConditionalGeneration,
|
| 11 |
)
|
| 12 |
from peft import PeftModel
|
| 13 |
-
import spaces
|
| 14 |
|
| 15 |
|
| 16 |
# ========= Config =========
|
|
@@ -76,7 +76,7 @@ def build_conversion_prompt(pre_reform_text: str) -> str:
|
|
| 76 |
)
|
| 77 |
|
| 78 |
|
| 79 |
-
|
| 80 |
def _ocr_image_to_text(image) -> str:
|
| 81 |
"""
|
| 82 |
Use OCRFlux-3B via chat templating. We create role/content messages,
|
|
|
|
| 10 |
Qwen2_5_VLForConditionalGeneration,
|
| 11 |
)
|
| 12 |
from peft import PeftModel
|
| 13 |
+
import spaces
|
| 14 |
|
| 15 |
|
| 16 |
# ========= Config =========
|
|
|
|
| 76 |
)
|
| 77 |
|
| 78 |
|
| 79 |
+
@spaces.GPU()
|
| 80 |
def _ocr_image_to_text(image) -> str:
|
| 81 |
"""
|
| 82 |
Use OCRFlux-3B via chat templating. We create role/content messages,
|