mirror of
https://github.com/huggingface/transformers.git
synced 2025-08-02 19:21:31 +06:00
Update comment
Co-authored-by: Yih-Dar <2521628+ydshieh@users.noreply.github.com>
This commit is contained in:
parent
e550d64ea0
commit
1941a44f74
@ -39,7 +39,7 @@ logger = logging.get_logger(__name__) # pylint: disable=invalid-name
|
|||||||
|
|
||||||
# TODO: This doesn't work for all packages (`bs4`, `faiss`, etc.) Talk to Sylvain to see how to do with it better.
|
# TODO: This doesn't work for all packages (`bs4`, `faiss`, etc.) Talk to Sylvain to see how to do with it better.
|
||||||
def _is_package_available(pkg_name: str, return_version: bool = False) -> Union[Tuple[bool, str], bool]:
|
def _is_package_available(pkg_name: str, return_version: bool = False) -> Union[Tuple[bool, str], bool]:
|
||||||
# Check if the package spec exists to avoid importing a local directory
|
# Check if the package spec exists and grab its version to avoid importing a local directory
|
||||||
package_exists = importlib.util.find_spec(pkg_name) is not None
|
package_exists = importlib.util.find_spec(pkg_name) is not None
|
||||||
package_version = "N/A"
|
package_version = "N/A"
|
||||||
if package_exists:
|
if package_exists:
|
||||||
|
Loading…
Reference in New Issue
Block a user