lukas-blecher / LaTeX-OCR

pix2tex: Using a ViT to convert images of equations into LaTeX code.
https://lukas-blecher.github.io/LaTeX-OCR/
MIT License
12.62k stars 1.03k forks source link

if possible? load local model files ? #168

Open yangboz opened 2 years ago

yangboz commented 2 years ago

found the local cached model file is weights.pth, image_resizer.pth . how to load it from local at first if not found then load them from remote url?

thanks in advance .

lukas-blecher commented 2 years ago

can you elaborate? That is how it's done at the moment

yangboz commented 2 years ago

inside https://github.com/lukas-blecher/LaTeX-OCR/blob/main/pix2tex/api/app.py of line 18 named load model func could be parameterized with local model file path?

lukas-blecher commented 2 years ago

You'll have to hard code it for now. Not sure how to do this with fastAPI. The GUI and CLI have this feature but the API does not for now.