Unverified Commit 117a0f6a authored by Arthur's avatar Arthur Committed by GitHub
Browse files

Small nit, (#22653)

* Small nit,
Fixes #21986

* Update src/transformers/pipelines/__init__.py
parent fc1ba6fd
...@@ -788,7 +788,6 @@ def pipeline( ...@@ -788,7 +788,6 @@ def pipeline(
model_config = model.config model_config = model.config
hub_kwargs["_commit_hash"] = model.config._commit_hash hub_kwargs["_commit_hash"] = model.config._commit_hash
load_tokenizer = type(model_config) in TOKENIZER_MAPPING or model_config.tokenizer_class is not None load_tokenizer = type(model_config) in TOKENIZER_MAPPING or model_config.tokenizer_class is not None
load_feature_extractor = type(model_config) in FEATURE_EXTRACTOR_MAPPING or feature_extractor is not None load_feature_extractor = type(model_config) in FEATURE_EXTRACTOR_MAPPING or feature_extractor is not None
load_image_processor = type(model_config) in IMAGE_PROCESSOR_MAPPING or image_processor is not None load_image_processor = type(model_config) in IMAGE_PROCESSOR_MAPPING or image_processor is not None
...@@ -871,7 +870,8 @@ def pipeline( ...@@ -871,7 +870,8 @@ def pipeline(
tokenizer_kwargs = tokenizer[1] tokenizer_kwargs = tokenizer[1]
else: else:
tokenizer_identifier = tokenizer tokenizer_identifier = tokenizer
tokenizer_kwargs = model_kwargs tokenizer_kwargs = model_kwargs.copy()
tokenizer_kwargs.pop("torch_dtype", None)
tokenizer = AutoTokenizer.from_pretrained( tokenizer = AutoTokenizer.from_pretrained(
tokenizer_identifier, use_fast=use_fast, _from_pipeline=task, **hub_kwargs, **tokenizer_kwargs tokenizer_identifier, use_fast=use_fast, _from_pipeline=task, **hub_kwargs, **tokenizer_kwargs
......
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