mirror of
https://github.com/huggingface/transformers.git
synced 2025-07-31 02:02:21 +06:00
fix code example in mgp-str doc (#22219)
Co-authored-by: yue kun <yuekun.wp@alibaba-inc.com>
This commit is contained in:
parent
33d033d694
commit
af1c864cdc
@ -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']
|
||||
|
Loading…
Reference in New Issue
Block a user