Skip to content

Commit

Permalink
Merge pull request #40 from will-rice/wr-refactor
Browse files Browse the repository at this point in the history
Major Refactor
  • Loading branch information
will-rice authored Nov 27, 2024
2 parents 03845a5 + f2da4bf commit 31783d0
Show file tree
Hide file tree
Showing 58 changed files with 4,567 additions and 1,729 deletions.
16 changes: 6 additions & 10 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,18 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11"]
python-version: ["3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install ruff pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Lint with ruff

- name: Install uv
run: |
ruff check .
- name: Test with pytest
curl -LsSf https://astral.sh/uv/install.sh | sh
- name: Run pre-commit hook
run: |
pytest
uv run pre-commit run -a
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -134,3 +134,6 @@ logs/

# ruff
.ruff_cache/

# mac
.DS_Store
9 changes: 0 additions & 9 deletions .mypy.ini

This file was deleted.

23 changes: 6 additions & 17 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,29 +12,18 @@ repos:
hooks:
- id: prettier
files: \.(css|less|scss|json|yaml|yml|html|md|mdx|js|jsx|ts|tsx|graphql|gql|vue|svelte|toml)$
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.1.3
hooks:
- id: ruff
args: ["--fix"]
- repo: local
hooks:
- id: black
name: black
language: system
entry: black
types: [python]
- id: isort
name: isort
- id: ruff
name: ruff
language: system
entry: isort
args: ["--profile", "black"]
types: [python]
entry: ruff check . --fix
pass_filenames: false
always_run: true
- id: mypy
name: mypy
language: system
entry: mypy denoisers
entry: mypy .
pass_filenames: false
always_run: true
- id: pytest
Expand Down
19 changes: 18 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@ Denoisers is a denoising library for audio with a focus on simplicity and ease o

[![Hugging Face Spaces](https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-Spaces-blue)](https://huggingface.co/spaces/wrice/denoisers)


## Usage/Examples

```sh
pip install denoisers
```

### Inference

```python
import torch
import torchaudio
Expand Down Expand Up @@ -43,3 +44,19 @@ for i in tqdm(range(0, padded.shape[-1], chunk_size)):

denoised = torch.concat(clean, 1)[:, :audio.shape[-1]]
```

### Train

```sh

train unet1d unet1d-24khz /data_root/

```

### Publish

```sh

publish model model_name /path/to/model

```
7 changes: 3 additions & 4 deletions bin/run
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

set -e

subsys=$1
command=$2
shift; shift
exec python -m "denoisers.scripts.$subsys.$command" "$@"
command=$1
shift
exec python -m "denoisers.scripts.$command" "$@"
1 change: 0 additions & 1 deletion denoisers/datamodules/__init__.py

This file was deleted.

126 changes: 0 additions & 126 deletions denoisers/datamodules/unet.py

This file was deleted.

114 changes: 0 additions & 114 deletions denoisers/datamodules/unet1d.py

This file was deleted.

Loading

0 comments on commit 31783d0

Please sign in to comment.