Long Trinh-Quang commited on
Commit
7851ad8
·
1 Parent(s): bd7103c

[FIX] dockerfile

Browse files
Files changed (3) hide show
  1. Dockerfile +38 -9
  2. app_tts.py +2 -2
  3. requirements.txt +40 -63
Dockerfile CHANGED
@@ -29,25 +29,54 @@ RUN apt-get update && \
29
  apt-get clean && \
30
  rm -rf /var/lib/apt/lists/*
31
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
32
  RUN useradd -m -u 1000 user
33
  USER user
34
  ENV HOME=/home/user \
35
- PATH=/home/user/.local/bin:${PATH}
36
  WORKDIR ${HOME}/app
37
 
38
  RUN curl https://pyenv.run | bash
39
- ENV PATH=${HOME}/.pyenv/shims:${HOME}/.pyenv/bin:${PATH}
40
  ENV PYTHON_VERSION=3.10.18
41
  RUN pyenv install ${PYTHON_VERSION} && \
42
  pyenv global ${PYTHON_VERSION} && \
43
  pyenv rehash && \
44
- pip install --no-cache-dir -U pip setuptools wheel
45
-
46
- RUN pip install --no-cache-dir -U torch==2.4.0+cu124 torchaudio==2.4.0+cu124 torchvision==0.19.0 --extra-index-url https://download.pytorch.org/whl/cu124
47
- COPY --chown=1000 requirements_f5tts.txt /tmp/requirements_f5tts.txt
48
- RUN pip install --no-cache-dir -U -r /tmp/requirements_f5tts.txt
49
- COPY --chown=1000 requirements.txt /tmp/requirements.txt
50
- RUN pip install --no-cache-dir -U -r /tmp/requirements.txt
51
 
52
  COPY --chown=1000 . ${HOME}/app
53
  RUN ls -a
 
29
  apt-get clean && \
30
  rm -rf /var/lib/apt/lists/*
31
 
32
+ # RUN useradd -m -u 1000 user
33
+ # USER user
34
+ # ENV HOME=/home/user \
35
+ # PATH=/home/user/.local/bin:${PATH}
36
+ # WORKDIR ${HOME}/app
37
+
38
+ # RUN curl https://pyenv.run | bash
39
+ # ENV PATH=${HOME}/.pyenv/shims:${HOME}/.pyenv/bin:${PATH}
40
+ # ENV PYTHON_VERSION=3.10.18
41
+ # RUN pyenv install ${PYTHON_VERSION} && \
42
+ # pyenv global ${PYTHON_VERSION} && \
43
+ # pyenv rehash && \
44
+ # pip install --no-cache-dir -U pip setuptools wheel
45
+
46
+ # RUN pip install --user --no-cache-dir -U torch==2.4.0+cu124 torchaudio==2.4.0+cu124 torchvision==0.19.0 --extra-index-url https://download.pytorch.org/whl/cu124
47
+ # RUN pip install --user --no-cache-dir -U f5_tts==1.1.9
48
+ # COPY --chown=1000 requirements_f5tts.txt /tmp/requirements_f5tts.txt
49
+ # RUN pip install --user --no-cache-dir -U -r /tmp/requirements_f5tts.txt
50
+ # COPY --chown=1000 requirements.txt /tmp/requirements.txt
51
+ # RUN pip install --user --no-cache-dir -U -r /tmp/requirements.txt
52
+
53
+ # COPY --chown=1000 . ${HOME}/app
54
+ # RUN ls -a
55
+ # ENV PYTHONPATH=${HOME}/app \
56
+ # PYTHONUNBUFFERED=1 \
57
+ # GRADIO_ALLOW_FLAGGING=never \
58
+ # GRADIO_NUM_PORTS=1 \
59
+ # GRADIO_SERVER_NAME=0.0.0.0 \
60
+ # GRADIO_THEME=huggingface \
61
+ # SYSTEM=spaces
62
+ # CMD ["python", "app.py"]
63
+
64
  RUN useradd -m -u 1000 user
65
  USER user
66
  ENV HOME=/home/user \
67
+ PATH=/home/user/.local/bin:${HOME}/.pyenv/shims:${HOME}/.pyenv/bin:${PATH}
68
  WORKDIR ${HOME}/app
69
 
70
  RUN curl https://pyenv.run | bash
 
71
  ENV PYTHON_VERSION=3.10.18
72
  RUN pyenv install ${PYTHON_VERSION} && \
73
  pyenv global ${PYTHON_VERSION} && \
74
  pyenv rehash && \
75
+ pyenv exec pip install --no-cache-dir -U pip setuptools wheel && \
76
+ pyenv exec pip install --no-cache-dir -U torch==2.4.0+cu124 torchaudio==2.4.0+cu124 torchvision==0.19.0 --extra-index-url https://download.pytorch.org/whl/cu124 && \
77
+ pyenv exec pip install --no-cache-dir -U f5_tts==1.1.9 && \
78
+ # pyenv exec pip install --no-cache-dir -U -r /tmp/requirements_f5tts.txt && \
79
+ pyenv exec pip install --no-cache-dir -U -r /tmp/requirements.txt
 
 
80
 
81
  COPY --chown=1000 . ${HOME}/app
82
  RUN ls -a
app_tts.py CHANGED
@@ -8,8 +8,8 @@ from cached_path import cached_path
8
  import tempfile
9
  from vinorm import TTSnorm
10
  from importlib.resources import files
11
- import sys
12
- sys.path.append(os.path.join(os.path.dirname(__file__), 'src'))
13
  from f5_tts.model import DiT
14
  from f5_tts.infer.utils_infer import (
15
  preprocess_ref_audio_text,
 
8
  import tempfile
9
  from vinorm import TTSnorm
10
  from importlib.resources import files
11
+ # import sys
12
+ # sys.path.append(os.path.join(os.path.dirname(__file__), 'src'))
13
  from f5_tts.model import DiT
14
  from f5_tts.infer.utils_infer import (
15
  preprocess_ref_audio_text,
requirements.txt CHANGED
@@ -1,71 +1,48 @@
1
- # CORE compatibility, bắt buộc
2
- # torch>=2.0.0,<2.5.0
3
- # torchaudio>=2.0.0,<2.5.0
4
- # torchvision>=0.15.0,<0.20.0
5
- f5-tts==1.1.9
6
-
7
- # API/Server compatibility (phù hợp với f5-tts)
8
- fastapi==0.116.1
9
- starlette==0.47.3
10
- pydantic<=2.10.6
11
-
12
- # Các package TTS/SadTalker, support model
13
- transformers==4.35.0
14
- tqdm>=4.65.0
15
-
16
- # Các thư viện xử lý ảnh, âm thanh
17
- imageio
18
- imageio-ffmpeg
19
- librosa
20
- numba
21
- pydub
22
- soundfile
23
- opencv-python
24
- av
25
-
26
- # Các package face/talk/animation
27
- face_alignment
28
- basicsr
29
  facexlib
30
  dlib-bin
31
  gfpgan
32
- kornia
33
- scikit-image
34
- scikit-learn
35
- yacs
36
- vocos
37
- vinorm
38
- x-transformers>=1.31.14
39
-
40
- # Các package phụ trợ (joblib, pandas, ...)
41
- joblib
42
- omegaconf
43
- matplotlib
44
- pyyaml
45
- pypinyin
46
- jieba
47
- hydra-core
48
- pyarrow
49
- soxr
50
- unidecode
51
 
52
- # Đẩy lên cuối, phần nào không critical thì bỏ version, hoặc <= nếu cần fix bug
53
- huggingface-hub
 
 
 
 
 
 
54
  accelerate>=0.33.0
 
55
  datasets
56
- bitsandbytes
 
 
 
 
 
 
 
 
57
  wandb
 
58
 
59
- # Gradio client/UI, DÙNG gradio>=5.0.0 để không conflict f5-tts
60
- gradio>=5.0.0
61
- gradio_client
62
-
63
- # Dọn dependency system
64
- protobuf
65
- filelock
66
- click
67
- rich
68
- requests
69
- typing_extensions
70
- python-dateutil
71
- packaging
 
1
+ # torch==2.4.0
2
+ # torchaudio==2.4.0
3
+ # torchvision==0.19.0
4
+
5
+ face_alignment==1.3.0
6
+ imageio==2.19.3
7
+ imageio-ffmpeg==0.4.7
8
+ librosa==0.8.0
9
+ numba==0.56.4
10
+ resampy==0.3.1
11
+ pydub==0.25.1
12
+ scipy
13
+ kornia==0.6.8
14
+ tqdm
15
+ yacs==0.1.8
16
+ pyyaml
17
+ joblib==1.1.0
18
+ scikit-image==0.19.3
19
+ basicsr==1.4.2
 
 
 
 
 
 
 
 
 
20
  facexlib
21
  dlib-bin
22
  gfpgan
23
+ av
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
24
 
25
+ safetensors
26
+ gradio
27
+ soundfile
28
+ transformers
29
+ bitsandbytes>0.37.0
30
+ vinorm
31
+ cached_path
32
+ huggingface_hub
33
  accelerate>=0.33.0
34
+ click
35
  datasets
36
+ ema_pytorch>=0.5.2
37
+ hydra-core>=1.3.0
38
+ jieba
39
+ matplotlib
40
+ pypinyin
41
+ tomli
42
+ torchdiffeq
43
+ transformers_stream_generator
44
+ vocos
45
  wandb
46
+ x_transformers>=1.31.14
47
 
48
+ spaces