1
0
mirror of synced 2024-11-12 01:40:51 +01:00

👷 Use black[jupyter] (#847)

* 👷 Use black[jupyter]

* 👷 Add missing matrix
This commit is contained in:
Nato Boram 2023-07-23 23:30:01 -04:00 committed by GitHub
parent 18067aa85d
commit ffc99dbd32
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 805 additions and 783 deletions

View File

@ -4,10 +4,19 @@ on: [pull_request]
permissions: permissions:
contents: write contents: write
jobs: jobs:
pull_format: pull_format:
runs-on: ubuntu-latest runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: ["3.10"]
os: [ubuntu-latest]
fail-fast: false
continue-on-error: true continue-on-error: true
steps: steps:
- name: checkout - name: checkout
continue-on-error: true continue-on-error: true
@ -16,14 +25,13 @@ jobs:
ref: ${{ github.head_ref }} ref: ${{ github.head_ref }}
fetch-depth: 0 fetch-depth: 0
- name: Set up Python ${{ matrix.python-version }} - name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4 uses: actions/setup-python@v4
with: with:
python-version: ${{ matrix.python-version }} python-version: ${{ matrix.python-version }}
- name: Install Black - name: Install Black
run: pip install black run: pip install "black[jupyter]"
- name: Run Black - name: Run Black
# run: black $(git ls-files '*.py') # run: black $(git ls-files '*.py')

View File

@ -8,9 +8,17 @@ on:
permissions: permissions:
contents: write contents: write
pull-requests: write pull-requests: write
jobs: jobs:
push_format: push_format:
runs-on: ubuntu-latest runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: ["3.10"]
os: [ubuntu-latest]
fail-fast: false
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
with: with:
@ -22,7 +30,7 @@ jobs:
python-version: ${{ matrix.python-version }} python-version: ${{ matrix.python-version }}
- name: Install Black - name: Install Black
run: pip install black run: pip install "black[jupyter]"
- name: Run Black - name: Run Black
# run: black $(git ls-files '*.py') # run: black $(git ls-files '*.py')

View File

@ -146,7 +146,8 @@
"# @title 挂载谷歌云盘\n", "# @title 挂载谷歌云盘\n",
"\n", "\n",
"from google.colab import drive\n", "from google.colab import drive\n",
"drive.mount('/content/drive')" "\n",
"drive.mount(\"/content/drive\")"
], ],
"metadata": { "metadata": {
"id": "jwu07JgqoFON" "id": "jwu07JgqoFON"
@ -160,7 +161,9 @@
"# @title 从谷歌云盘加载打包好的数据集到/content/dataset\n", "# @title 从谷歌云盘加载打包好的数据集到/content/dataset\n",
"\n", "\n",
"# @markdown 数据集位置\n", "# @markdown 数据集位置\n",
"DATASET = \"/content/drive/MyDrive/dataset/lulu20230327_32k.zip\" #@param {type:\"string\"}\n", "DATASET = (\n",
" \"/content/drive/MyDrive/dataset/lulu20230327_32k.zip\" # @param {type:\"string\"}\n",
")\n",
"\n", "\n",
"!mkdir -p /content/dataset\n", "!mkdir -p /content/dataset\n",
"!unzip -d /content/dataset -B {DATASET}" "!unzip -d /content/dataset -B {DATASET}"
@ -259,7 +262,7 @@
"# @markdown 使用的进程数\n", "# @markdown 使用的进程数\n",
"THREADCOUNT = 8 # @param {type:\"integer\"}\n", "THREADCOUNT = 8 # @param {type:\"integer\"}\n",
"\n", "\n",
"!python3 trainset_preprocess_pipeline_print.py /content/dataset {BITRATE} {THREADCOUNT} logs/{MODELNAME} True\n" "!python3 trainset_preprocess_pipeline_print.py /content/dataset {BITRATE} {THREADCOUNT} logs/{MODELNAME} True"
], ],
"metadata": { "metadata": {
"id": "ZKAyuKb9J6dz" "id": "ZKAyuKb9J6dz"
@ -280,7 +283,7 @@
"\n", "\n",
"!python3 extract_f0_print.py logs/{MODELNAME} {THREADCOUNT} {ALGO}\n", "!python3 extract_f0_print.py logs/{MODELNAME} {THREADCOUNT} {ALGO}\n",
"\n", "\n",
"!python3 extract_feature_print.py cpu 1 0 0 logs/{MODELNAME}\n" "!python3 extract_feature_print.py cpu 1 0 0 logs/{MODELNAME}"
], ],
"metadata": { "metadata": {
"id": "CrxJqzAUKmPJ" "id": "CrxJqzAUKmPJ"
@ -309,7 +312,7 @@
"# @markdown 是否仅保存最新的ckpt文件\n", "# @markdown 是否仅保存最新的ckpt文件\n",
"ONLYLATEST = 0 # @param {type:\"integer\"}\n", "ONLYLATEST = 0 # @param {type:\"integer\"}\n",
"\n", "\n",
"!python3 train_nsf_sim_cache_sid_load_pretrain.py -e lulu -sr {MODELSAMPLE} -f0 1 -bs {BATCHSIZE} -g {USEGPU} -te {MODELEPOCH} -se {EPOCHSAVE} -pg pretrained/f0G{MODELSAMPLE}.pth -pd pretrained/f0D{MODELSAMPLE}.pth -l {ONLYLATEST} -c {CACHEDATA}\n" "!python3 train_nsf_sim_cache_sid_load_pretrain.py -e lulu -sr {MODELSAMPLE} -f0 1 -bs {BATCHSIZE} -g {USEGPU} -te {MODELEPOCH} -se {EPOCHSAVE} -pg pretrained/f0G{MODELSAMPLE}.pth -pd pretrained/f0D{MODELSAMPLE}.pth -l {ONLYLATEST} -c {CACHEDATA}"
], ],
"metadata": { "metadata": {
"id": "IMLPLKOaKj58" "id": "IMLPLKOaKj58"

View File

@ -154,7 +154,8 @@
"# @title 挂载谷歌云盘\n", "# @title 挂载谷歌云盘\n",
"\n", "\n",
"from google.colab import drive\n", "from google.colab import drive\n",
"drive.mount('/content/drive')" "\n",
"drive.mount(\"/content/drive\")"
] ]
}, },
{ {
@ -168,7 +169,9 @@
"# @title 从谷歌云盘加载打包好的数据集到/content/dataset\n", "# @title 从谷歌云盘加载打包好的数据集到/content/dataset\n",
"\n", "\n",
"# @markdown 数据集位置\n", "# @markdown 数据集位置\n",
"DATASET = \"/content/drive/MyDrive/dataset/lulu20230327_32k.zip\" #@param {type:\"string\"}\n", "DATASET = (\n",
" \"/content/drive/MyDrive/dataset/lulu20230327_32k.zip\" # @param {type:\"string\"}\n",
")\n",
"\n", "\n",
"!mkdir -p /content/dataset\n", "!mkdir -p /content/dataset\n",
"!unzip -d /content/dataset -B {DATASET}" "!unzip -d /content/dataset -B {DATASET}"
@ -267,7 +270,7 @@
"# @markdown 使用的进程数\n", "# @markdown 使用的进程数\n",
"THREADCOUNT = 8 # @param {type:\"integer\"}\n", "THREADCOUNT = 8 # @param {type:\"integer\"}\n",
"\n", "\n",
"!python3 trainset_preprocess_pipeline_print.py /content/dataset {BITRATE} {THREADCOUNT} logs/{MODELNAME} True\n" "!python3 trainset_preprocess_pipeline_print.py /content/dataset {BITRATE} {THREADCOUNT} logs/{MODELNAME} True"
] ]
}, },
{ {
@ -288,7 +291,7 @@
"\n", "\n",
"!python3 extract_f0_print.py logs/{MODELNAME} {THREADCOUNT} {ALGO}\n", "!python3 extract_f0_print.py logs/{MODELNAME} {THREADCOUNT} {ALGO}\n",
"\n", "\n",
"!python3 extract_feature_print.py cpu 1 0 0 logs/{MODELNAME}\n" "!python3 extract_feature_print.py cpu 1 0 0 logs/{MODELNAME}"
] ]
}, },
{ {
@ -317,7 +320,7 @@
"# @markdown 是否仅保存最新的ckpt文件\n", "# @markdown 是否仅保存最新的ckpt文件\n",
"ONLYLATEST = 0 # @param {type:\"integer\"}\n", "ONLYLATEST = 0 # @param {type:\"integer\"}\n",
"\n", "\n",
"!python3 train_nsf_sim_cache_sid_load_pretrain.py -e lulu -sr {MODELSAMPLE} -f0 1 -bs {BATCHSIZE} -g {USEGPU} -te {MODELEPOCH} -se {EPOCHSAVE} -pg pretrained/f0G{MODELSAMPLE}.pth -pd pretrained/f0D{MODELSAMPLE}.pth -l {ONLYLATEST} -c {CACHEDATA}\n" "!python3 train_nsf_sim_cache_sid_load_pretrain.py -e lulu -sr {MODELSAMPLE} -f0 1 -bs {BATCHSIZE} -g {USEGPU} -te {MODELEPOCH} -se {EPOCHSAVE} -pg pretrained/f0G{MODELSAMPLE}.pth -pd pretrained/f0D{MODELSAMPLE}.pth -l {ONLYLATEST} -c {CACHEDATA}"
] ]
}, },
{ {