khaled06 commited on
Commit
6dff512
1 Parent(s): 8912ed0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -2
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")