-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add torchaudio version check in egs2/librispeech/ssl1/local/path.sh
- Loading branch information
1 parent
99cea47
commit 86b51e9
Showing
1 changed file
with
21 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |