Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,6 +1,7 @@
|
|
| 1 |
import os
|
| 2 |
import random
|
| 3 |
import uuid
|
|
|
|
| 4 |
import time
|
| 5 |
import base64
|
| 6 |
from http import HTTPStatus
|
|
@@ -126,7 +127,7 @@ def format_history_for_model(history, selected_model):
|
|
| 126 |
|
| 127 |
return text, images, selected_model
|
| 128 |
|
| 129 |
-
|
| 130 |
# --- Gradio Events and Application Logic ---
|
| 131 |
class Gradio_Events:
|
| 132 |
|
|
@@ -306,16 +307,6 @@ welcome_prompts = [
|
|
| 306 |
"description": "Convert this page to docling",
|
| 307 |
"urls": ["https://huggingface.co/spaces/prithivMLmods/Multimodal-OCR2/resolve/main/images/1.png"]
|
| 308 |
},
|
| 309 |
-
{
|
| 310 |
-
"title": "Convert Chart",
|
| 311 |
-
"description": "Convert chart to OTSL.",
|
| 312 |
-
"urls": ["https://huggingface.co/spaces/prithivMLmods/Multimodal-OCR2/resolve/main/images/4.png"]
|
| 313 |
-
},
|
| 314 |
-
{
|
| 315 |
-
"title": "Extract Code",
|
| 316 |
-
"description": "Convert code to text",
|
| 317 |
-
"urls": ["https://huggingface.co/spaces/prithivMLmods/Multimodal-OCR2/resolve/main/images/5.jpg"]
|
| 318 |
-
},
|
| 319 |
]
|
| 320 |
|
| 321 |
with gr.Blocks(css=css, fill_width=True, title="Multimodal OCR2") as demo:
|
|
|
|
| 1 |
import os
|
| 2 |
import random
|
| 3 |
import uuid
|
| 4 |
+
import spaces
|
| 5 |
import time
|
| 6 |
import base64
|
| 7 |
from http import HTTPStatus
|
|
|
|
| 127 |
|
| 128 |
return text, images, selected_model
|
| 129 |
|
| 130 |
+
@spaces.GPU
|
| 131 |
# --- Gradio Events and Application Logic ---
|
| 132 |
class Gradio_Events:
|
| 133 |
|
|
|
|
| 307 |
"description": "Convert this page to docling",
|
| 308 |
"urls": ["https://huggingface.co/spaces/prithivMLmods/Multimodal-OCR2/resolve/main/images/1.png"]
|
| 309 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 310 |
]
|
| 311 |
|
| 312 |
with gr.Blocks(css=css, fill_width=True, title="Multimodal OCR2") as demo:
|