Update README.md
Browse files
README.md
CHANGED
@@ -42,15 +42,15 @@ from transformers import VisionEncoderDecoderModel
|
|
42 |
from transformers.models.nougat import NougatTokenizerFast
|
43 |
from nougat_latex import NougatLaTexProcessor
|
44 |
|
45 |
-
|
46 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
47 |
# init model
|
48 |
-
model = VisionEncoderDecoderModel.from_pretrained(
|
49 |
|
50 |
# init processor
|
51 |
-
tokenizer = NougatTokenizerFast.from_pretrained(
|
52 |
|
53 |
-
latex_processor = NougatLaTexProcessor.from_pretrained(
|
54 |
|
55 |
# run test
|
56 |
image = Image.open("path/to/latex/image.png")
|
|
|
42 |
from transformers.models.nougat import NougatTokenizerFast
|
43 |
from nougat_latex import NougatLaTexProcessor
|
44 |
|
45 |
+
model_name = "Norm/nougat-latex-base"
|
46 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
47 |
# init model
|
48 |
+
model = VisionEncoderDecoderModel.from_pretrained(model_name).to(device)
|
49 |
|
50 |
# init processor
|
51 |
+
tokenizer = NougatTokenizerFast.from_pretrained(model_name)
|
52 |
|
53 |
+
latex_processor = NougatLaTexProcessor.from_pretrained(model_name)
|
54 |
|
55 |
# run test
|
56 |
image = Image.open("path/to/latex/image.png")
|