[Bugfix][V1] Avoid importing PreTrainedModel (#15366)
Signed-off-by: Hollow Man <hollowman@opensuse.org>
This commit is contained in:
@@ -32,7 +32,7 @@ def set_default_torch_dtype(dtype: torch.dtype):
|
|||||||
|
|
||||||
def is_transformers_impl_compatible(
|
def is_transformers_impl_compatible(
|
||||||
arch: str,
|
arch: str,
|
||||||
module: Optional[transformers.PreTrainedModel] = None) -> bool:
|
module: Optional["transformers.PreTrainedModel"] = None) -> bool:
|
||||||
mod = module or getattr(transformers, arch, None)
|
mod = module or getattr(transformers, arch, None)
|
||||||
if mod is None:
|
if mod is None:
|
||||||
return False
|
return False
|
||||||
|
|||||||
Reference in New Issue
Block a user