Skip to content

Commit a22b821

Browse files
regissslibintadsoceknprotasovhsubramony
authored
Upgrade to Transformers v4.49 (#1810)
Signed-off-by: Daniel Socek <daniel.socek@intel.com> Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com> Co-authored-by: Libin Tang <litang@habana.ai> Co-authored-by: Daniel Socek <daniel.socek@intel.com> Co-authored-by: Nikolay Protasov <nikolay.protasov@intel.com> Co-authored-by: Harish Subramony <81822986+hsubramony@users.noreply.github.com> Co-authored-by: U. Artie Eoff <ullysses.a.eoff@intel.com> Co-authored-by: Yeonsil Yoon <yyoon@habana.ai> Co-authored-by: Luca Calabria <luca.calabria@intel.com> Co-authored-by: Shiv Kaul <skaul@habana.ai> Co-authored-by: Iman Gohari <s.m.iman.gohari@intel.com> Co-authored-by: Harshvardhan Chauhan <hchauhan@habana.ai>
1 parent 45dc3aa commit a22b821

64 files changed

Lines changed: 1341 additions & 995 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

examples/audio-classification/run_audio_classification.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def check_optimum_habana_min_version(*a, **b):
4646
logger = logging.getLogger(__name__)
4747

4848
# Will error if the minimal version of Transformers and Optimum Habana are not installed. Remove at your own risks.
49-
check_min_version("4.48.0")
49+
check_min_version("4.49.0")
5050
check_optimum_habana_min_version("1.17.0.dev0")
5151

5252
require_version("datasets>=1.14.0", "To fix: pip install -r examples/pytorch/audio-classification/requirements.txt")

examples/contrastive-image-text/run_bridgetower.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def check_optimum_habana_min_version(*a, **b):
5858
logger = logging.getLogger(__name__)
5959

6060
# Will error if the minimal version of Transformers and Optimum Habana are not installed. Remove at your own risks.
61-
check_min_version("4.48.0")
61+
check_min_version("4.49.0")
6262
check_optimum_habana_min_version("1.17.0.dev0")
6363

6464
require_version("datasets>=1.8.0", "To fix: pip install -r examples/pytorch/contrastive-image-text/requirements.txt")

examples/contrastive-image-text/run_clip.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def check_optimum_habana_min_version(*a, **b):
6161
logger = logging.getLogger(__name__)
6262

6363
# Will error if the minimal version of Transformers and Optimum Habana are not installed. Remove at your own risks.
64-
check_min_version("4.48.0")
64+
check_min_version("4.49.0")
6565
check_optimum_habana_min_version("1.17.0.dev0")
6666

6767
require_version("datasets>=1.8.0", "To fix: pip install -r examples/pytorch/contrastive-image-text/requirements.txt")

examples/image-classification/run_image_classification.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def check_optimum_habana_min_version(*a, **b):
6464
logger = logging.getLogger(__name__)
6565

6666
# Will error if the minimal version of Transformers and Optimum Habana are not installed. Remove at your own risks.
67-
check_min_version("4.48.0")
67+
check_min_version("4.49.0")
6868
check_optimum_habana_min_version("1.17.0.dev0")
6969

7070
require_version("datasets>=2.14.0", "To fix: pip install -r examples/pytorch/image-classification/requirements.txt")

examples/image-to-text/run_image2text_lora_finetune.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -382,8 +382,8 @@ def eval(processor, model, dataset, batch_size, use_lazy_mode, use_hpu_graphs, m
382382
images,
383383
texts,
384384
return_tensors="pt",
385-
padding="max_length",
386-
truncation=True,
385+
padding=True,
386+
truncation=False,
387387
max_length=max_seq_length,
388388
padding_side="left",
389389
)
@@ -611,15 +611,12 @@ def main():
611611
text = processor.apply_chat_template(messages, add_generation_prompt=True)
612612

613613
if config.model_type == "llava":
614-
# don't expand image_token_id
615-
setattr(processor, "patch_size", None)
616-
setattr(processor, "vision_feature_select_strategy", None)
617614
inputs = processor(
618615
[image],
619616
[text.strip()],
620617
return_tensors="pt",
621-
padding="max_length",
622-
truncation=True,
618+
padding=True,
619+
truncation=False,
623620
max_length=data_args.max_seq_length,
624621
padding_side="left",
625622
)

examples/language-modeling/run_clm.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def check_optimum_habana_min_version(*a, **b):
6262
logger = logging.getLogger(__name__)
6363

6464
# Will error if the minimal version of Transformers and Optimum Habana are not installed. Remove at your own risks.
65-
check_min_version("4.48.0")
65+
check_min_version("4.49.0")
6666
check_optimum_habana_min_version("1.17.0.dev0")
6767

6868
require_version("datasets>=2.14.0", "To fix: pip install -r examples/pytorch/language-modeling/requirements.txt")

examples/language-modeling/run_mlm.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def check_optimum_habana_min_version(*a, **b):
6161
logger = logging.getLogger(__name__)
6262

6363
# Will error if the minimal version of Transformers and Optimum Habana are not installed. Remove at your own risks.
64-
check_min_version("4.48.0")
64+
check_min_version("4.49.0")
6565
check_optimum_habana_min_version("1.17.0.dev0")
6666

6767
require_version("datasets>=2.14.0", "To fix: pip install -r examples/pytorch/language-modeling/requirements.txt")

examples/language-modeling/run_multitask_prompt_tuning.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def check_optimum_habana_min_version(*a, **b):
6060
logger = logging.getLogger(__name__)
6161

6262
# Will error if the minimal version of Transformers and Optimum Habana are not installed. Remove at your own risk.
63-
check_min_version("4.48.0")
63+
check_min_version("4.49.0")
6464
check_optimum_habana_min_version("1.17.0.dev0")
6565

6666
require_version("datasets>=1.8.0", "To fix: pip install -r examples/pytorch/language-modeling/requirements.txt")

examples/language-modeling/run_prompt_tuning_clm.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def check_optimum_habana_min_version(*a, **b):
6262
logger = logging.getLogger(__name__)
6363

6464
# Will error if the minimal version of Transformers and Optimum Habana are not installed. Remove at your own risks.
65-
check_min_version("4.48.0")
65+
check_min_version("4.49.0")
6666
check_optimum_habana_min_version("1.17.0.dev0")
6767

6868
require_version("datasets>=1.8.0", "To fix: pip install -r examples/pytorch/language-modeling/requirements.txt")

examples/question-answering/run_qa.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def check_optimum_habana_min_version(*a, **b):
6060
logger = logging.getLogger(__name__)
6161

6262
# Will error if the minimal version of Transformers and Optimum Habana are not installed. Remove at your own risks.
63-
check_min_version("4.48.0")
63+
check_min_version("4.49.0")
6464
check_optimum_habana_min_version("1.17.0.dev0")
6565

6666
require_version("datasets>=1.8.0", "To fix: pip install -r examples/pytorch/question-answering/requirements.txt")

0 commit comments

Comments
 (0)