Add is_torch_available, is_flax_available#204
Merged
Conversation
|
The documentation is not available anymore as the PR was closed or merged. |
Contributor
|
Cool! |
patil-suraj
approved these changes
Aug 17, 2022
Contributor
patil-suraj
left a comment
There was a problem hiding this comment.
Looks good! Thanks a lot for the cleanup.
Comment on lines
-40
to
-60
| _transformers_available = importlib.util.find_spec("transformers") is not None | ||
| try: | ||
| _transformers_version = importlib_metadata.version("transformers") | ||
| logger.debug(f"Successfully imported transformers version {_transformers_version}") | ||
| except importlib_metadata.PackageNotFoundError: | ||
| _transformers_available = False | ||
|
|
||
|
|
||
| _inflect_available = importlib.util.find_spec("inflect") is not None | ||
| try: | ||
| _inflect_version = importlib_metadata.version("inflect") | ||
| logger.debug(f"Successfully imported inflect version {_inflect_version}") | ||
| except importlib_metadata.PackageNotFoundError: | ||
| _inflect_available = False | ||
|
|
||
|
|
||
| _unidecode_available = importlib.util.find_spec("unidecode") is not None | ||
| try: | ||
| _unidecode_version = importlib_metadata.version("unidecode") | ||
| logger.debug(f"Successfully imported unidecode version {_unidecode_version}") | ||
| except importlib_metadata.PackageNotFoundError: |
Comment on lines
+40
to
+41
| USE_TORCH = os.environ.get("USE_TORCH", "AUTO").upper() | ||
| USE_JAX = os.environ.get("USE_FLAX", "AUTO").upper() |
Contributor
There was a problem hiding this comment.
maybe let's not add TF and JAX stuff just yet as we don't have any immediate plans to support other frameworks. But also fine with it, don't feel strongly about this.
yoonseokjin
pushed a commit
to yoonseokjin/diffusers
that referenced
this pull request
Dec 25, 2023
* Add is_<framework>_available, refactor import utils * deps * quality
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This adds the framework checks which are the first step to get
make repo-consistencyandcheck_repo.pyworking, but also will be useful for our flax integration.Also refactoring import utils into their own file.