Commit Β·
ba5ca25
1
Parent(s): b758851
Decorate process_pdf with @spaces.GPU (ZeroGPU Space requires a GPU fn)
Browse files
docling_pdf_processor/web/gradio_app.py
CHANGED
|
@@ -14,6 +14,7 @@ from pathlib import Path
|
|
| 14 |
from typing import Any, Dict, List, Tuple
|
| 15 |
|
| 16 |
import gradio as gr
|
|
|
|
| 17 |
|
| 18 |
from docling_pdf_processor.config import settings
|
| 19 |
from docling_pdf_processor.logging_config import setup_logging
|
|
@@ -106,6 +107,7 @@ def _format_status(status: str) -> str:
|
|
| 106 |
|
| 107 |
# ββ Event handlers βββββββββββββββββββββββββββββββββββββββββββββ
|
| 108 |
|
|
|
|
| 109 |
def process_pdf(
|
| 110 |
pdf_file,
|
| 111 |
openrouter_key: str,
|
|
|
|
| 14 |
from typing import Any, Dict, List, Tuple
|
| 15 |
|
| 16 |
import gradio as gr
|
| 17 |
+
import spaces
|
| 18 |
|
| 19 |
from docling_pdf_processor.config import settings
|
| 20 |
from docling_pdf_processor.logging_config import setup_logging
|
|
|
|
| 107 |
|
| 108 |
# ββ Event handlers βββββββββββββββββββββββββββββββββββββββββββββ
|
| 109 |
|
| 110 |
+
@spaces.GPU
|
| 111 |
def process_pdf(
|
| 112 |
pdf_file,
|
| 113 |
openrouter_key: str,
|