docs: Minor fixes to demo code on README

#1
Files changed (1) hide show
  1. README.md +2 -2
README.md CHANGED
@@ -29,10 +29,10 @@ processor = AutoProcessor.from_pretrained("nielsr/layoutxlm-finetuned-xfund-fr")
29
  model = AutoModelForTokenClassification.from_pretrained(nielsr/layoutxlm-finetuned-xfund-fr")
30
 
31
  # assuming you have a French document, turned into an image
32
- image = Image("...").convert("RGB")
33
 
34
  # prepare for the model
35
- encoding = processor(image, return_offsets_mapping=True, padding="max_length", max_length=512, truncation=True, return_tensors="pt")
36
 
37
  with torch.no_grad():
38
  outputs = model(**encoding)
29
  model = AutoModelForTokenClassification.from_pretrained(nielsr/layoutxlm-finetuned-xfund-fr")
30
 
31
  # assuming you have a French document, turned into an image
32
+ image = Image.open("...").convert("RGB")
33
 
34
  # prepare for the model
35
+ encoding = processor(image, padding="max_length", max_length=512, truncation=True, return_tensors="pt")
36
 
37
  with torch.no_grad():
38
  outputs = model(**encoding)