Skip to content

Commit

Permalink
fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
IlyasMoutawwakil committed Jan 13, 2025
1 parent 7597692 commit a6b3a8e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions optimum/utils/import_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
def _is_package_available(
pkg_name: str,
return_version: bool = False,
alternative_pkg_names: Optional[List[str]] = None,
alt_pkg_names: Optional[List[str]] = None,
) -> Union[Tuple[bool, str], bool]:
"""
Check if a package is available in the current environment and not just an importable module by checking its version.
Expand All @@ -48,7 +48,7 @@ def _is_package_available(
Args:
pkg_name (str): The name of the package to check.
return_version (bool): Whether to return the version of the package.
alternative_pkg_names (Optional[List[str]]): A list of alternative package names to check if the main package
alt_pkg_names (Optional[List[str]]): A list of alternative package names to check if the main package
name is not found.
Returns:
Expand All @@ -58,7 +58,7 @@ def _is_package_available(
package_exists = importlib.util.find_spec(pkg_name) is not None
package_version = "N/A"
if package_exists:
for candidate_pkg in [pkg_name] + (alternative_pkg_names or []):
for pkg in [pkg_name] + (alt_pkg_names or []):
try:
package_version = importlib.metadata.version(pkg)
package_exists = True
Expand Down

0 comments on commit a6b3a8e

Please sign in to comment.