dvsth/LEGIT
Viewer β’ Updated β’ 21.2k β’ 26
How to use dvsth/LEGIT-TrOCR-MT with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("feature-extraction", model="dvsth/LEGIT-TrOCR-MT", trust_remote_code=True) # pip install -U transformers accelerate
# Load model directly
from transformers import AutoTokenizer, AutoModel
tokenizer = AutoTokenizer.from_pretrained("dvsth/LEGIT-TrOCR-MT", trust_remote_code=True)
model = AutoModel.from_pretrained("dvsth/LEGIT-TrOCR-MT", trust_remote_code=True, device_map="auto")Code and quickstart available at: https://github.com/dvsth/learning-legibility-2023