Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add torchaudio version check for HuBERT pretraining #4872

Merged
merged 1 commit into from
Jan 18, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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