Clean up internals, fix bugs, add tests + CI#15
Merged
Conversation
1635962 to
6ac0187
Compare
…eak circular import
…uard cuda, organize imports
cb20dfb to
d8134cb
Compare
d8134cb to
acb873c
Compare
ae8a2a3 to
b7bda6c
Compare
b7bda6c to
1e98553
Compare
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.
Summary
Remove internal/unused code, fix several bugs, deduplicate utils, and add a basic test suite with CI.
Changes
Removed unused code
model/train.py,dataset/,bench/,requirements.txtmodel/infer.pyafter extractingload_cnn_model()intopredictor.pyBug fixes
hcqm.py: Changeddevice='cuda'default todevice=None, resolved withget_device()— no longer crashes on CPU-only machinesload_cnn_model(): Addedweights_only=Truetotorch.load()batch_infer.py: Guardedtorch.cuda.empty_cache()withis_available()checkbatch_infer.py: Fixed indentation, removed straypassCode deduplication (
utils.py)split_audio()is now the core implementationload_and_split_audio()is a thin wrapper that loads then delegatessplit_audioraisesValueErroron too-short audio instead of silently returningNoneload_and_split_audiocatches exceptions with a clear error messagePackage structure
__init__.pytomodel/andaudio_proc/predictor.pyandbatch_infer.pyPackaging (
pyproject.toml)requestsruntime dependencypytest,ruff)Tests + CI
Verification
pip install -e ".[dev]"— installs cleanlyruff check src/— all checks passedpytest— 7/7 passpython -m deeprhythm.infer --help— CLI works