fix code example in mgp-str doc (#22219)

Co-authored-by: yue kun <yuekun.wp@alibaba-inc.com>
This commit is contained in:
wangpeng 2023-03-17 17:40:06 +08:00 committed by GitHub
parent 33d033d694
commit af1c864cdc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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']