Skip to content

Commit

Permalink
Fix FA2 import + deprecation cycle (#27330)
Browse files Browse the repository at this point in the history
* put back import

* switch to logger.warnings instead
  • Loading branch information
SunMarc authored and LysandreJik committed Nov 14, 2023
1 parent d8fffbe commit f047370
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/transformers/utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@
is_essentia_available,
is_faiss_available,
is_flash_attn_2_available,
is_flash_attn_available,
is_flax_available,
is_fsdp_available,
is_ftfy_available,
Expand Down
8 changes: 8 additions & 0 deletions src/transformers/utils/import_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -614,6 +614,14 @@ def is_flash_attn_2_available():
return _flash_attn_2_available and torch.cuda.is_available()


def is_flash_attn_available():
logger.warning(
"Using `is_flash_attn_available` is deprecated and will be removed in v4.38. "
"Please use `is_flash_attn_2_available` instead."
)
return is_flash_attn_2_available()


def is_torchdistx_available():
return _torchdistx_available

Expand Down

0 comments on commit f047370

Please sign in to comment.