small fixes

This commit is contained in:
Fangjun Kuang 2023-07-24 12:19:47 +08:00
parent 1868136b40
commit 7bba2bc350
2 changed files with 16 additions and 29 deletions

View File

@ -2,6 +2,8 @@ name: build-wheels-cpu-ubuntu
on: on:
push: push:
branches:
- wheels
tags: tags:
- '*' - '*'
workflow_dispatch: workflow_dispatch:
@ -92,19 +94,20 @@ jobs:
# https://huggingface.co/docs/hub/spaces-github-actions # https://huggingface.co/docs/hub/spaces-github-actions
- name: Publish to huggingface - name: Publish to huggingface
if: github.repository_owner == 'csukuangfj' if: github.repository_owner == 'csukuangfj'
shell: bash
env: env:
HF_TOKEN: ${{ secrets.HF_TOKEN }} HF_TOKEN: ${{ secrets.HF_TOKEN }}
run: | uses: nick-fields/retry@v2
git config --global user.email "csukuangfj@gmail.com" with:
git config --global user.name "Fangjun Kuang" max_attempts: 10
timeout_seconds: 10
shell: bash
command: |
git config --global user.email "csukuangfj@gmail.com"
git config --global user.name "Fangjun Kuang"
export GIT_LFS_SKIP_SMUDGE=1 export GIT_LFS_SKIP_SMUDGE=1
git clone https://huggingface.co/csukuangfj/kaldifeat huggingface git clone https://huggingface.co/csukuangfj/kaldifeat huggingface
cur_path=$PWD
function push_to_huggingface() {
cd $cur_path
rm -rf huggingface rm -rf huggingface
git clone https://huggingface.co/csukuangfj/kaldifeat huggingface git clone https://huggingface.co/csukuangfj/kaldifeat huggingface
cd huggingface cd huggingface
@ -117,12 +120,3 @@ jobs:
git add . git add .
git commit -m "upload ubuntu-cpu wheel for torch ${{ matrix.torch }} python ${{ matrix.python-version }}" git commit -m "upload ubuntu-cpu wheel for torch ${{ matrix.torch }} python ${{ matrix.python-version }}"
git push https://csukuangfj:$HF_TOKEN@huggingface.co/csukuangfj/kaldifeat main git push https://csukuangfj:$HF_TOKEN@huggingface.co/csukuangfj/kaldifeat main
cd ..
rm -rf huggingface
}
function retry() {
$* || (sleep 1 && $*) || (sleep 2 && $*) || (sleep 4 && $*) || (sleep 8 && $*)
}
retry push_to_huggingface

View File

@ -15,20 +15,13 @@ if [ -z $TORCH_VERSION ]; then
exit 1 exit 1
fi fi
echo "Installing ${PYTHON_VERSION}.1"
yum -y install openssl-devel bzip2-devel libffi-devel xz-devel wget redhat-lsb-core yum -y install openssl-devel bzip2-devel libffi-devel xz-devel wget redhat-lsb-core
echo "Installing ${PYTHON_VERSION}.3"
if [[ $PYTHON_VERSION == 3.6 ]]; then curl -O https://www.python.org/ftp/python/${PYTHON_VERSION}.3/Python-${PYTHON_VERSION}.3.tgz
curl -O https://www.python.org/ftp/python/${PYTHON_VERSION}.1/Python-${PYTHON_VERSION}.1.tgz tar xf Python-${PYTHON_VERSION}.3.tgz
tar xf Python-${PYTHON_VERSION}.1.tgz pushd Python-${PYTHON_VERSION}.3
pushd Python-${PYTHON_VERSION}.1
else
curl -O https://www.python.org/ftp/python/${PYTHON_VERSION}.9/Python-${PYTHON_VERSION}.1.tgz
tar xf Python-${PYTHON_VERSION}.9.tgz
pushd Python-${PYTHON_VERSION}.9
fi
PYTHON_INSTALL_DIR=$PWD/py-${PYTHON_VERSION} PYTHON_INSTALL_DIR=$PWD/py-${PYTHON_VERSION}