mirror of
https://github.com/huggingface/transformers.git
synced 2025-07-31 02:02:21 +06:00
Restore package_exists
This commit is contained in:
parent
1941a44f74
commit
66fd2cd5c3
@ -46,6 +46,7 @@ def _is_package_available(pkg_name: str, return_version: bool = False) -> Union[
|
||||
try:
|
||||
# Primary method to get the package version
|
||||
package_version = importlib.metadata.version(pkg_name)
|
||||
package_exists = True
|
||||
except importlib.metadata.PackageNotFoundError:
|
||||
# Fallback method: Only for "torch" and versions containing "dev"
|
||||
if pkg_name == "torch":
|
||||
|
Loading…
Reference in New Issue
Block a user