@@ -228,12 +228,12 @@ def load(path: Path, **kwargs: Any) -> PeftModel: # noqa: ANN401, ARG004
228228 if (path / "ptuning" ).exists ():
229229 # prompt learning model
230230 ptuning_path = path / "ptuning"
231- model = AutoModelForSequenceClassification .from_pretrained (ptuning_path / "base_model" ) # type: ignore[no-untyped-call]
231+ model = AutoModelForSequenceClassification .from_pretrained (ptuning_path / "base_model" )
232232 return PeftModel .from_pretrained (model , ptuning_path / "peft" )
233233 if (path / "lora" ).exists ():
234234 # merged lora model
235235 lora_path = path / "lora"
236- return AutoModelForSequenceClassification .from_pretrained (lora_path ) # type: ignore[no-untyped-call,no- any-return]
236+ return AutoModelForSequenceClassification .from_pretrained (lora_path ) # type: ignore[no-any-return]
237237 msg = f"Invalid PeftModel directory structure at { path } . Expected 'ptuning' or 'lora' subdirectory."
238238 raise ValueError (msg )
239239
@@ -252,7 +252,7 @@ def dump(obj: PreTrainedModel, path: Path, exists_ok: bool) -> None:
252252
253253 @staticmethod
254254 def load (path : Path , ** kwargs : Any ) -> PreTrainedModel : # noqa: ANN401, ARG004
255- return AutoModelForSequenceClassification .from_pretrained (path ) # type: ignore[no-untyped-call,no- any-return]
255+ return AutoModelForSequenceClassification .from_pretrained (path ) # type: ignore[no-any-return]
256256
257257 @classmethod
258258 def check_isinstance (cls , obj : Any ) -> bool : # noqa: ANN401
@@ -269,7 +269,7 @@ def dump(obj: PreTrainedTokenizer | PreTrainedTokenizerFast, path: Path, exists_
269269
270270 @staticmethod
271271 def load (path : Path , ** kwargs : Any ) -> PreTrainedTokenizer | PreTrainedTokenizerFast : # noqa: ANN401, ARG004
272- return AutoTokenizer .from_pretrained (path ) # type: ignore[no-any-return]
272+ return AutoTokenizer .from_pretrained (path ) # type: ignore[no-any-return,no-untyped-call ]
273273
274274 @classmethod
275275 def check_isinstance (cls , obj : Any ) -> bool : # noqa: ANN401
0 commit comments