We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents dd7352f + 55aaea4 commit 41ef04aCopy full SHA for 41ef04a
src/unitxt/inference.py
@@ -972,16 +972,18 @@ def _get_model_args(self) -> Dict[str, Any]:
972
return args
973
974
def _create_pipeline(self, model_args: Dict[str, Any]):
975
- from transformers import pipeline
+ from transformers import AutoTokenizer, pipeline
976
977
path = self.model_name
978
if settings.hf_offline_models_path is not None:
979
path = os.path.join(settings.hf_offline_models_path, path)
980
981
+ tokenizer = AutoTokenizer.from_pretrained(self.model_name)
982
self.model = pipeline(
983
model=path,
984
task=self.task,
985
use_fast=self.use_fast_tokenizer,
986
+ tokenizer=tokenizer,
987
trust_remote_code=settings.allow_unverified_code,
988
**model_args,
989
**self.to_dict(
0 commit comments