Unverified Commit af1c864c authored by wangpeng's avatar wangpeng Committed by GitHub
Browse files

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


Co-authored-by: default avataryue kun <yuekun.wp@alibaba-inc.com>
parent 33d033d6
......@@ -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']
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment