Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
transformers
Commits
af1c864c
Unverified
Commit
af1c864c
authored
Mar 17, 2023
by
wangpeng
Committed by
GitHub
Mar 17, 2023
Browse files
fix code example in mgp-str doc (#22219)
Co-authored-by:
yue kun
<
yuekun.wp@alibaba-inc.com
>
parent
33d033d6
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
docs/source/en/model_doc/mgp-str.mdx
docs/source/en/model_doc/mgp-str.mdx
+1
-1
No files found.
docs/source/en/model_doc/mgp-str.mdx
View file @
af1c864c
...
...
@@ -54,7 +54,7 @@ into a single instance to both extract the input features and decode the predict
>>> url = "https://i.postimg.cc/ZKwLg2Gw/367-14.png"
>>> image = Image.open(requests.get(url, stream=True).raw).convert("RGB")
>>> pixel_values = processor(image, return_tensors="pt").pixel_values
>>> pixel_values = processor(
images=
image, return_tensors="pt").pixel_values
>>> outputs = model(pixel_values)
>>> generated_text = processor.batch_decode(outputs.logits)['generated_text']
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment