Norm commited on
Commit
9ee8c29
1 Parent(s): f36f15b

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +4 -4
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("Norm/nougat-latex-base").to(device)
49
 
50
  # init processor
51
- tokenizer = NougatTokenizerFast.from_pretrained("Norm/nougat-latex-base")
52
 
53
- latex_processor = NougatLaTexProcessor.from_pretrained("Norm/nougat-latex-base")
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")