Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -3,8 +3,13 @@ import gradio as gr
|
|
3 |
from PIL import Image
|
4 |
|
5 |
# Load OCR model
|
6 |
-
tokenizer = AutoTokenizer.from_pretrained('ucaslcl/GOT-OCR2_0', trust_remote_code=True)
|
7 |
-
model = AutoModel.from_pretrained('ucaslcl/GOT-OCR2_0', trust_remote_code=True, device_map='cuda', low_cpu_mem_usage=True)
|
|
|
|
|
|
|
|
|
|
|
8 |
|
9 |
# Summarization model
|
10 |
summarizer = pipeline("summarization", model="facebook/bart-large-cnn")
|
|
|
3 |
from PIL import Image
|
4 |
|
5 |
# Load OCR model
|
6 |
+
# tokenizer = AutoTokenizer.from_pretrained('ucaslcl/GOT-OCR2_0', trust_remote_code=True)
|
7 |
+
# model = AutoModel.from_pretrained('ucaslcl/GOT-OCR2_0', trust_remote_code=True, device_map='cuda', low_cpu_mem_usage=True)
|
8 |
+
|
9 |
+
|
10 |
+
tokenizer = AutoTokenizer.from_pretrained('srimanth-d/GOT_CPU', trust_remote_code=True)
|
11 |
+
model = AutoModel.from_pretrained('srimanth-d/GOT_CPU', trust_remote_code=True, low_cpu_mem_usage=True, use_safetensors=True, pad_token_id=tokenizer.eos_token_id)
|
12 |
+
model = model.eval()
|
13 |
|
14 |
# Summarization model
|
15 |
summarizer = pipeline("summarization", model="facebook/bart-large-cnn")
|