nielsr HF staff commited on
Commit
cd8713a
1 Parent(s): fbb9037

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +3 -1
README.md CHANGED
@@ -29,11 +29,13 @@ model = AutoModelForTokenClassification.from_pretrained(nielsr/layoutxlm-finetun
29
  image = Image("...").convert("RGB")
30
 
31
  # prepare for the model
32
- encoding = processor(image, return_tensors="pt")
33
 
34
  with torch.no_grad():
35
  outputs = model(**encoding)
36
  logits = outputs.logits
 
 
37
  ```
38
 
39
  ## Intended uses & limitations
 
29
  image = Image("...").convert("RGB")
30
 
31
  # prepare for the model
32
+ encoding = processor(image, return_offsets_mapping=True, padding="max_length", max_length=512, truncation=True, return_tensors="pt")
33
 
34
  with torch.no_grad():
35
  outputs = model(**encoding)
36
  logits = outputs.logits
37
+
38
+ predictions = logits.argmax(-1)
39
  ```
40
 
41
  ## Intended uses & limitations