Conversation
|
Thank you for the PR! +1 for moving away from setup.py. -1 for removing requirements.txt; the requirements in pyproject.toml are too strict now (e.g., beat_this runs fine with older versions of PyTorch than 2.3.1, and even faster in case your GPU is not supported by flash attention v2, but by v1). I haven't used hatchling before; do the defaults install the same set of files as the original setup.py? setup.py actually detected the launch_scripts directory as a package, which was unintended. The huggingface integration is surprisingly little code, but comes at the disadvantage of requiring hubbingface_hub as a dependency. Also the way it is implemented, it will prevent instantiating the model from a local checkpoint file in case the file path includes a slash. Would it be possible to make huggingface optional, and define a Storing the models in FP16 would be an option for us as well, but I'd like to compare results when running on CPU. |
|
This PR modernizes the project by transitioning from
setup.pytopyproject.tomlfor configuration, improving compatibility with modern Python packaging standards.The
final0model has also been published on the Hugging Face Hub assafe-models/beat-this-final0, stored in safetensors FP16 format since all tensor values are within range. This optimization reduces the model size by approximately 50%, bringing it down to ~40MB while maintaining performance. Additionally, the download speed is faster now, thanks to Hugging Face's optimized networking.Copilot generated summary:
This pull request includes significant updates to the
beat_thisproject, focusing on enhancing model loading functionality, integrating with the Hugging Face Hub, and transitioning the build system to usepyproject.toml.Model Loading Enhancements:
beat_this/inference.py: Modified theload_modelfunction to handle cases wherecheckpoint_pathisNoneand to useBeatThis.from_pretrainedfor loading pretrained models. [1] [2]Hugging Face Hub Integration:
beat_this/model/beat_tracker.py: AddedPyTorchModelHubMixinto theBeatThisclass to enable integration with the Hugging Face Hub.Build System Transition:
pyproject.toml: Introducedpyproject.tomlfor project configuration, specifying dependencies and build system requirements usinghatchling.setup.py: Removedsetup.pyin favor of usingpyproject.tomlfor project configuration.