Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
eaidova committed Oct 12, 2023
1 parent 68e727c commit 47bb44a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions optimum/intel/openvino/modeling_seq2seq.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,12 +158,12 @@
```python
>>> from transformers import {processor_class}
>>> from optimum.onnxruntime import {model_class}
>>> from optimum.intel import {model_class}
>>> from PIL import Image
>>> import requests
>>> processor = {processor_class}.from_pretrained("{checkpoint}")
>>> model = {model_class}.from_pretrained("{checkpoint}", export=True, use_io_binding=True)
>>> model = {model_class}.from_pretrained("{checkpoint}", export=True)
>>> url = "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/tasks/ai2d-demo.jpg"
>>> image = Image.open(requests.get(url, stream=True).raw)
Expand All @@ -185,7 +185,7 @@
class OVModelForSeq2SeqLM(OVBaseModelForSeq2SeqLM, GenerationMixin):
auto_model_class = AutoModelForSeq2SeqLM
main_input_name = "input_ids"
export_feature = "image-to-text"
export_feature = "text2text-generation"

def __init__(
self,
Expand Down Expand Up @@ -522,6 +522,7 @@ def _compile(self):
class OVModelForPix2Struct(OVModelForSeq2SeqLM):
auto_model_class = Pix2StructForConditionalGeneration
main_input_name = "flattened_patches"
export_feature = "image-to-text"

def prepare_inputs_for_generation(
self,
Expand Down

0 comments on commit 47bb44a

Please sign in to comment.