-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathcopy_files_to_espnet.sh
executable file
·38 lines (30 loc) · 1.68 KB
/
copy_files_to_espnet.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/usr/bin/env bash
# Copyright (C) 2024 Mitsubishi Electric Research Laboratories (MERL)
#
# SPDX-License-Identifier: Apache-2.0
espnet_root=$1
cdir=${PWD}
# Copy the TF-Locoformer code.
cp ${cdir}/espnet2/enh/separator/tflocoformer_separator.py ${espnet_root}/espnet2/enh/separator
# Apply the patch file to enh.py to import TF-Locoformer.
# enh.py is directly modified by patching and the original enh.py is saved as enh.py.orig.
# .orig file can be deleted if it is not necessary.
cd ${espnet_root}/espnet2/tasks && patch -b < ${cdir}/espnet2/tasks/enh.patch && cd ${cdir}
# Copy other files.
for dset in wsj0_2mix whamr librimix dns_ins20; do
# Copy separate.py on each egs2
cp ${cdir}/egs2/wsj0_2mix/enh1/separate.py ${espnet_root}/egs2/${dset}/enh1
# Copy the config file
cp ${cdir}/egs2/${dset}/enh1/conf/tuning/train_enh_tflocoformer.yaml ${espnet_root}/egs2/${dset}/enh1/conf/tuning
# Copy the pre-trained model
mkdir -p ${espnet_root}/egs2/${dset}/enh1/exp
cp -r ${cdir}/egs2/${dset}/enh1/exp/enh_train_enh_tflocoformer_raw ${espnet_root}/egs2/${dset}/enh1/exp/enh_train_enh_tflocoformer_pretrained
# whamr has small and medium models
if [ $dset = "whamr" ]; then
cp ${cdir}/egs2/${dset}/enh1/conf/tuning/train_enh_tflocoformer_small.yaml ${espnet_root}/egs2/${dset}/enh1/conf/tuning
cp -r ${cdir}/egs2/${dset}/enh1/exp/enh_train_enh_tflocoformer_small_raw ${espnet_root}/egs2/${dset}/enh1/exp/enh_train_enh_tflocoformer_small_pretrained
fi
done
# Copy patch files.
cp ${cdir}/egs2/whamr/enh1/local/whamr_data_prep.patch ${espnet_root}/egs2/whamr/enh1/local
cp ${cdir}/egs2/librimix/enh1/local/data.patch ${espnet_root}/egs2/librimix/enh1/local