Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -3,6 +3,7 @@ import spaces
|
|
3 |
from transformers import AutoModel, AutoTokenizer
|
4 |
from PIL import Image
|
5 |
import numpy as np
|
|
|
6 |
|
7 |
tokenizer = AutoTokenizer.from_pretrained('ucaslcl/GOT-OCR2_0', trust_remote_code=True)
|
8 |
model = AutoModel.from_pretrained('ucaslcl/GOT-OCR2_0', trust_remote_code=True, low_cpu_mem_usage=True, device_map='cuda', use_safetensors=True)
|
@@ -30,6 +31,7 @@ def run_GOT(image_array, got_mode, fine_grained_mode="", ocr_color="", ocr_box="
|
|
30 |
with open(html_file, 'r') as f:
|
31 |
demo_html = f.read()
|
32 |
print("demo_html: \n", demo_html)
|
|
|
33 |
return res, demo_html
|
34 |
return res, None
|
35 |
|
|
|
3 |
from transformers import AutoModel, AutoTokenizer
|
4 |
from PIL import Image
|
5 |
import numpy as np
|
6 |
+
import os
|
7 |
|
8 |
tokenizer = AutoTokenizer.from_pretrained('ucaslcl/GOT-OCR2_0', trust_remote_code=True)
|
9 |
model = AutoModel.from_pretrained('ucaslcl/GOT-OCR2_0', trust_remote_code=True, low_cpu_mem_usage=True, device_map='cuda', use_safetensors=True)
|
|
|
31 |
with open(html_file, 'r') as f:
|
32 |
demo_html = f.read()
|
33 |
print("demo_html: \n", demo_html)
|
34 |
+
print(os.path.abspath(html_file))
|
35 |
return res, demo_html
|
36 |
return res, None
|
37 |
|