PolSOL / model.py
MasteredUltraInstinct's picture
Create model.py
be9c806 verified
raw
history blame
270 Bytes
from pix2tex.cli import LatexOCR
from pix2tex.model import get_model as pix2tex_model
from pix2tex.utils import Tokenizer
def get_model(weights='trained_model'):
tokenizer = Tokenizer()
model = pix2tex_model(checkpoint_path=weights)
return model, tokenizer