Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
@@ -8,9 +8,7 @@ tokenizer = AutoTokenizer.from_pretrained('ucaslcl/GOT-OCR2_0', trust_remote_cod
|
|
8 |
model = AutoModel.from_pretrained('ucaslcl/GOT-OCR2_0',
|
9 |
trust_remote_code=True,
|
10 |
low_cpu_mem_usage=True,
|
11 |
-
device_map='cuda'
|
12 |
-
use_safetensors=True,
|
13 |
-
pad_token_id=tokenizer.eos_token_id).eval().cuda()
|
14 |
|
15 |
# Define the function to process images and extract text
|
16 |
def extract_text_from_image(image):
|
|
|
8 |
model = AutoModel.from_pretrained('ucaslcl/GOT-OCR2_0',
|
9 |
trust_remote_code=True,
|
10 |
low_cpu_mem_usage=True,
|
11 |
+
pad_token_id=tokenizer.eos_token_id).eval() # Removed device_map='cuda' and .cuda()
|
|
|
|
|
12 |
|
13 |
# Define the function to process images and extract text
|
14 |
def extract_text_from_image(image):
|