Update app.py
Browse files
app.py
CHANGED
@@ -3,6 +3,11 @@ from transformers import TrOCRProcessor, VisionEncoderDecoderModel
|
|
3 |
import requests
|
4 |
from PIL import Image
|
5 |
|
|
|
|
|
|
|
|
|
|
|
6 |
processor = TrOCRProcessor.from_pretrained("microsoft/trocr-small-printed")
|
7 |
model = VisionEncoderDecoderModel.from_pretrained("yhshin/latex-ocr")
|
8 |
|
|
|
3 |
import requests
|
4 |
from PIL import Image
|
5 |
|
6 |
+
url = 'https://huggingface.co/yhshin/latex-ocr/raw/main/tokenizer-wordlevel.json'
|
7 |
+
r = requests.get(url)
|
8 |
+
open('tokenizer-wordlevel.json' , 'w').write(r.content)
|
9 |
+
|
10 |
+
|
11 |
processor = TrOCRProcessor.from_pretrained("microsoft/trocr-small-printed")
|
12 |
model = VisionEncoderDecoderModel.from_pretrained("yhshin/latex-ocr")
|
13 |
|