Relative imports are quirky and not well documented
When uploading a custom model that has multiple files to HuggingFace Hub, thedocumentationpassingly mentions that “relative imports” are allowed if all files are in the same directory, but it turns out that only a specific format of relative import is supported.Let’s say I have modelsmy_model.pyandmy_config.pyand the former wants to import the latter. The first two methods I used for relative importing didn’t work with weird errors and only the third one (that defies Google style guides is permitted):relative at module level:from . import my_configThis leads to an error like the following:ImportError: cannot import name 'my_config' from 'transformers_modules.<user>.<repo>.<branch>' (/Users/farzad/.cache/huggingface/modules/transformers_modules/farzadab/test-uv-pipeline/d66aec12954c4e0382d482f1efe0e5ef79c6e310/__init__.py)normal import as top-level:import my_configThe leads to the error:ImportError: This modeling file requires the following packages that were not found in your environment: my_config. Run `pip install my_config`the only one that works (which I’d rather not use since it violates Google style guides):from .my_config import MyConfigI believe this should be documented better or the error messages should be improved.Also I’d appreciate it if option#1was also allowed for consistency.