Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,6 +1,7 @@
|
|
| 1 |
import os
|
| 2 |
import gradio_pdf
|
| 3 |
import hashlib
|
|
|
|
| 4 |
import re
|
| 5 |
import time
|
| 6 |
import click
|
|
@@ -42,7 +43,7 @@ model = Qwen2_5_VLForConditionalGeneration.from_pretrained(
|
|
| 42 |
torch_dtype=torch.float16 if device == "cuda" else torch.float32
|
| 43 |
).to(device).eval()
|
| 44 |
|
| 45 |
-
|
| 46 |
def parse_page(image: Image.Image) -> str:
|
| 47 |
messages = [
|
| 48 |
{
|
|
|
|
| 1 |
import os
|
| 2 |
import gradio_pdf
|
| 3 |
import hashlib
|
| 4 |
+
import spaces
|
| 5 |
import re
|
| 6 |
import time
|
| 7 |
import click
|
|
|
|
| 43 |
torch_dtype=torch.float16 if device == "cuda" else torch.float32
|
| 44 |
).to(device).eval()
|
| 45 |
|
| 46 |
+
@spaces.GPU
|
| 47 |
def parse_page(image: Image.Image) -> str:
|
| 48 |
messages = [
|
| 49 |
{
|