Skip to content

Conversation

@MekkCyber
Copy link
Contributor

What does this PR do?

Reverts #41411, because for some packages like optimum we don't have loaders as expected from most packages.

Copy link
Contributor

@vasqu vasqu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the same applies to FA3 for example 😢

@MekkCyber
Copy link
Contributor Author

I think in FA3 we do have loaders

@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@vasqu
Copy link
Contributor

vasqu commented Oct 27, 2025

Nope, just checked. Spec is there, loader is None

Have it locally installed

@MekkCyber
Copy link
Contributor Author

they don't have an __init__.py file ?

Copy link
Member

@BenjaminBossan BenjaminBossan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fixes the original issue, thanks for the quick action.

@vasqu
Copy link
Contributor

vasqu commented Oct 27, 2025

They do, but they don't make it as an importable function as per the pkg name --> "flash_attn_3" is not importable and the loader check fails here.

@MekkCyber
Copy link
Contributor Author

I'm not sure what you mean @vasqu, for example here, just creating the __init__.py file makes the folder loadable :

/scripts_training$ python
Python 3.12.11 (main, Sep 18 2025, 19:47:19) [Clang 20.1.4 ] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import importlib.util
>>> importlib.util.find_spec("test")
>>> ^D
(dev) /scripts_training$ mkdir test
(dev) /scripts_training$ python
Python 3.12.11 (main, Sep 18 2025, 19:47:19) [Clang 20.1.4 ] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import importlib.util
>>> importlib.util.find_spec("test")
ModuleSpec(name='test', loader=None, submodule_search_locations=_NamespacePath(['/scripts_training/test', '/scripts_training/test']))
>>> ^D
(dev) /scripts_training$ touch test/__init__.py
(dev) /scripts_training$ python
Python 3.12.11 (main, Sep 18 2025, 19:47:19) [Clang 20.1.4 ] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import importlib.util
>>> importlib.util.find_spec("test")
ModuleSpec(name='test', loader=<_frozen_importlib_external.SourceFileLoader object at 0x7f768f8f0110>, origin='/scripts_training/test/__init__.py', submodule_search_locations=['/scripts_training/test'])
>>> 

@MekkCyber MekkCyber merged commit 1f0b490 into main Oct 27, 2025
24 checks passed
@MekkCyber MekkCyber deleted the revert_import_fix branch October 27, 2025 12:59
i3hz pushed a commit to i3hz/transformers that referenced this pull request Oct 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants