

chore: add more tasks
@e1a691059ddc4c0053569756ca5f5d8450380794
--- Taskfile.yaml
+++ Taskfile.yaml
... | ... | @@ -1,11 +1,17 @@ |
1 | 1 |
version: "3" |
2 | 2 |
tasks: |
3 |
- speaches: poetry run uvicorn speaches.main:app {{.CLI_ARGS}} |
|
3 |
+ speaches: poetry run uvicorn --host 0.0.0.0 speaches.main:app {{.CLI_ARGS}} |
|
4 | 4 |
test: |
5 | 5 |
cmds: |
6 | 6 |
- poetry run pytest -o log_cli=true -o log_cli_level=DEBUG {{.CLI_ARGS}} |
7 | 7 |
sources: |
8 | 8 |
- "**/*.py" |
9 |
+ build: |
|
10 |
+ cmds: |
|
11 |
+ - docker compose build |
|
12 |
+ sources: |
|
13 |
+ - Dockerfile.* |
|
14 |
+ - speaches/*.py |
|
9 | 15 |
build-and-push: |
10 | 16 |
cmds: |
11 | 17 |
- docker compose build --push |
... | ... | @@ -13,3 +19,19 @@ |
13 | 19 |
- Dockerfile.* |
14 | 20 |
- speaches/*.py |
15 | 21 |
sync: lsyncd -nodaemon -delay 0 -rsyncssh . gpu-box speaches |
22 |
+ # Python's urllib3 takes forever when ipv6 is enabled |
|
23 |
+ # https://support.nordvpn.com/hc/en-us/articles/20164669224337-How-to-disable-IPv6-on-Linux |
|
24 |
+ disable-ipv6: sudo sysctl -w net.ipv6.conf.all.disable_ipv6=1 && sudo sysctl -w net.ipv6.conf.default.disable_ipv6=1 |
|
25 |
+ enable-ipv6: sudo sysctl -w net.ipv6.conf.all.disable_ipv6=0 && sudo sysctl -w net.ipv6.conf.default.disable_ipv6=0 |
|
26 |
+ download-test-data: |
|
27 |
+ # Downlod audio files for testing into `tests/data` |
|
28 |
+ cmds: |
|
29 |
+ - huggingface-cli download --repo-type dataset 'google/fleurs' 'data/en_us/audio/dev.tar.gz' |
|
30 |
+ - cp $HOME/.cache/huggingface/hub/datasets--google--fleurs/snapshots/199e4ae37915137c555b1765c01477c216287d34/data/en_us/audio/dev.tar.gz . |
|
31 |
+ - tar xzf dev.tar.gz |
|
32 |
+ - rm dev.tar.gz |
|
33 |
+ - mkdir -p tests/data |
|
34 |
+ - mv dev/* tests/data |
|
35 |
+ - rm -r dev |
|
36 |
+ - ls tests/data/*.wav | parallel ffmpeg -y -hide_banner -i {} -ac 1 -ar 16000 -f s16le -acodec pcm_s16le {.}.raw |
|
37 |
+ - ls tests/data | grep -v '\.raw$' | xargs -I {} rm -rf tests/data/{} |
--- flake.nix
+++ flake.nix
... | ... | @@ -21,6 +21,7 @@ |
21 | 21 |
ffmpeg-full |
22 | 22 |
go-task |
23 | 23 |
lsyncd |
24 |
+ parallel |
|
24 | 25 |
poetry |
25 | 26 |
pre-commit |
26 | 27 |
pv |
Add a comment
Delete comment
Once you delete this comment, you won't be able to recover it. Are you sure you want to delete this comment?