Skip to content

Commit

Permalink
Merge pull request #4872 from simpleoier/hubert
Browse files Browse the repository at this point in the history
Add torchaudio version check for HuBERT pretraining
  • Loading branch information
mergify[bot] committed Jan 18, 2023
2 parents 99cea47 + 86b51e9 commit 9ec35ac
Showing 1 changed file with 21 additions and 4 deletions.
25 changes: 21 additions & 4 deletions egs2/librispeech/ssl1/local/path.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,24 @@
# check extra module installation
torchaudio_version=$(python3 -c "import torchaudio; print(torchaudio.__version__)")

torchaudio_plus(){
python3 <<EOF
from packaging.version import parse as L
if L('$torchaudio_version') >= L('$1'):
print("true")
else:
print("false")
EOF
}

if ! $(torchaudio_plus 0.13.1); then
echo "We recommend to run hubert with torchaudio version >= 0.13.1." >$2
fi

if ! python3 -c "import fairseq" > /dev/null; then
echo "Error: fairseq is not installed." >&2
echo "Error: please install fairseq and its dependencies as follows:" >&2
echo "Error: cd ${MAIN_ROOT}/tools && make fairseq.done" >&2
echo "Warning: fairseq is not installed." >&2
echo "Warning: ignore this warning if torchaudio hubert config is used." >&2
echo "Warning: please install fairseq and its dependencies as follows:" >&2
echo "Warning: cd ${MAIN_ROOT}/tools && make fairseq.done" >&2
return 1
fi
fi

0 comments on commit 9ec35ac

Please sign in to comment.