HoneyTian commited on
Commit
a1550df
1 Parent(s): fadfe74
Files changed (5) hide show
  1. Dockerfile +1 -1
  2. README.md +38 -0
  3. install.sh +6 -11
  4. requirements.txt +5 -0
  5. script/install_conda.sh +59 -0
Dockerfile CHANGED
@@ -1,7 +1,7 @@
1
  # read the doc: https://huggingface.co/docs/hub/spaces-sdks-docker
2
  # you will also find guides on how best to write your Dockerfile
3
 
4
- FROM python:3.6
5
 
6
  WORKDIR /code
7
 
 
1
  # read the doc: https://huggingface.co/docs/hub/spaces-sdks-docker
2
  # you will also find guides on how best to write your Dockerfile
3
 
4
+ FROM python:3.8
5
 
6
  WORKDIR /code
7
 
README.md CHANGED
@@ -9,3 +9,41 @@ license: apache-2.0
9
  ---
10
 
11
  Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9
  ---
10
 
11
  Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
12
+
13
+ ### ASR
14
+
15
+ ```text
16
+ docker build -t asr:v20240510_0944 .
17
+
18
+ docker run -itd \
19
+ --name ASR \
20
+ asr:v20240510_0944
21
+
22
+ ```
23
+
24
+
25
+ ### 异常1
26
+
27
+ https://blog.csdn.net/sinat_28442665/article/details/126154991
28
+ ```text
29
+ ImportError: libpython3.8.so.1.0: cannot open shared object file: No such file or directory
30
+ ```
31
+
32
+ 查找 libpython3.8.so.1.0 共享库所在目录
33
+ ```text
34
+ find / -name libpython3.8.so.1.0
35
+ ```
36
+
37
+ 添加 LD_LIBRARY_PATH
38
+ ```text
39
+ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/miniconda3/envs/ASR/lib/
40
+ ```
41
+
42
+
43
+ ### 异常2
44
+
45
+ https://blog.csdn.net/qq_38225558/article/details/128641561
46
+ ```text
47
+ ImportError: /lib64/libm.so.6: version `GLIBC_2.27' not found
48
+ ```
49
+
install.sh CHANGED
@@ -39,10 +39,8 @@ while true; do
39
  esac
40
  done
41
 
42
- work_dir="$(pwd)"
43
- data_dir="$(pwd)/data"
44
 
45
- mkdir -p "${data_dir}"
46
 
47
 
48
  if [ ${system_version} = "centos" ]; then
@@ -53,20 +51,17 @@ fi
53
 
54
 
55
  if [ ${stage} -le 1 ] && [ ${stop_stage} -ge 1 ]; then
56
- $verbose && echo "stage 1: install python"
57
  cd "${work_dir}" || exit 1;
58
 
59
- sh ./script/install_python.sh --python_version "${python_version}" --system_version "${system_version}"
60
 
61
  fi
62
 
63
 
64
  if [ ${stage} -le 2 ] && [ ${stop_stage} -ge 2 ]; then
65
- $verbose && echo "stage 2: create virtualenv"
66
- /usr/local/python-${python_version}/bin/pip3 install virtualenv
67
- mkdir -p /data/local/bin
68
- cd /data/local/bin || exit 1;
69
- # source /data/local/bin/ASR/bin/activate
70
- /usr/local/python-${python_version}/bin/virtualenv ASR
71
 
 
 
72
  fi
 
39
  esac
40
  done
41
 
 
 
42
 
43
+ work_dir="$(pwd)"
44
 
45
 
46
  if [ ${system_version} = "centos" ]; then
 
51
 
52
 
53
  if [ ${stage} -le 1 ] && [ ${stop_stage} -ge 1 ]; then
54
+ $verbose && echo "stage 1: install miniconda"
55
  cd "${work_dir}" || exit 1;
56
 
57
+ sh ./script/install_conda.sh --system_version "${system_version}"
58
 
59
  fi
60
 
61
 
62
  if [ ${stage} -le 2 ] && [ ${stop_stage} -ge 2 ]; then
63
+ $verbose && echo "stage 2: create conda env"
 
 
 
 
 
64
 
65
+ # source activate MFA
66
+ conda create -n MFA python==3.8
67
  fi
requirements.txt CHANGED
@@ -1,2 +1,7 @@
1
  gradio==4.29.0
 
 
 
 
2
  https://huggingface.co/csukuangfj/wheels/resolve/main/2023-01-30/k2_sherpa-1.1-cp38-cp38-linux_x86_64.whl
 
 
1
  gradio==4.29.0
2
+ torch==1.13.1
3
+ torchaudio==0.13.1
4
+
5
+ https://huggingface.co/csukuangfj/wheels/resolve/main/2023-01-30/k2-1.23.4.dev20230130%2Bcpu.torch1.13.1-cp38-cp38-linux_x86_64.whl
6
  https://huggingface.co/csukuangfj/wheels/resolve/main/2023-01-30/k2_sherpa-1.1-cp38-cp38-linux_x86_64.whl
7
+ https://huggingface.co/csukuangfj/wheels/resolve/main/2023-01-30/kaldifeat-1.22-cp38-cp38-linux_x86_64.whl
script/install_conda.sh ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env bash
2
+
3
+ # https://www.5axxw.com/questions/simple/umiecs
4
+
5
+
6
+ # params:
7
+ system_version="centos";
8
+
9
+
10
+ # parse options
11
+ while true; do
12
+ [ -z "${1:-}" ] && break; # break if there are no arguments
13
+ case "$1" in
14
+ --*) name=$(echo "$1" | sed s/^--// | sed s/-/_/g);
15
+ eval '[ -z "${'"$name"'+xxx}" ]' && echo "$0: invalid option $1" 1>&2 && exit 1;
16
+ old_value="(eval echo \\$$name)";
17
+ if [ "${old_value}" == "true" ] || [ "${old_value}" == "false" ]; then
18
+ was_bool=true;
19
+ else
20
+ was_bool=false;
21
+ fi
22
+
23
+ # Set the variable to the right value-- the escaped quotes make it work if
24
+ # the option had spaces, like --cmd "queue.pl -sync y"
25
+ eval "${name}=\"$2\"";
26
+
27
+ # Check that Boolean-valued arguments are really Boolean.
28
+ if $was_bool && [[ "$2" != "true" && "$2" != "false" ]]; then
29
+ echo "$0: expected \"true\" or \"false\": $1 $2" 1>&2
30
+ exit 1;
31
+ fi
32
+ shift 2;
33
+ ;;
34
+
35
+ *) break;
36
+ esac
37
+ done
38
+
39
+
40
+ echo "system_version: ${system_version}";
41
+
42
+
43
+ if [ ${system_version} = "centos" ]; then
44
+ wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
45
+
46
+ bash Miniconda3-latest-Linux-x86_64.sh
47
+
48
+ /usr/local/miniconda3/bin/conda --version
49
+
50
+ cat ~/.bashrc
51
+ echo "PATH=$PATH:/usr/local/miniconda3/bin" >> /root/.bashrc
52
+ source ~/.bashrc
53
+
54
+ conda --version
55
+
56
+ fi
57
+
58
+
59
+