hysts HF staff commited on
Commit
3229aca
·
1 Parent(s): 53669bb
.gitattributes CHANGED
@@ -36,3 +36,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
36
  assets/mountain.mp4 filter=lfs diff=lfs merge=lfs -text
37
  assets/river.mp4 filter=lfs diff=lfs merge=lfs -text
38
  q8_kernels-0.0.0-cp39-cp39-linux_x86_64.whl filter=lfs diff=lfs merge=lfs -text
 
 
36
  assets/mountain.mp4 filter=lfs diff=lfs merge=lfs -text
37
  assets/river.mp4 filter=lfs diff=lfs merge=lfs -text
38
  q8_kernels-0.0.0-cp39-cp39-linux_x86_64.whl filter=lfs diff=lfs merge=lfs -text
39
+ *.whl filter=lfs diff=lfs merge=lfs -text
Dockerfile CHANGED
@@ -1,56 +1,58 @@
1
- FROM nvidia/cuda:12.4.0-devel-ubuntu20.04
2
-
3
- WORKDIR /code
4
-
5
- COPY ./requirements.txt /code/requirements.txt
6
-
7
- LABEL maintainer="Hugging Face"
8
- LABEL repository="diffusers"
9
-
10
  ENV DEBIAN_FRONTEND=noninteractive
11
-
12
- RUN apt-get -y update \
13
- && apt-get install -y software-properties-common \
14
- && add-apt-repository ppa:deadsnakes/ppa
15
-
16
- RUN apt install -y bash \
17
- build-essential \
18
- wget \
19
  git \
20
  git-lfs \
 
21
  curl \
22
- ca-certificates \
23
- libsndfile1-dev \
24
- libgl1 \
25
- python3.10 \
26
- python3.10-dev \
27
- python3-pip \
28
- python3.10-venv && \
29
- rm -rf /var/lib/apt/lists
30
-
31
- RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
 
 
 
 
 
 
 
 
32
 
33
- # Set up a new user named "user" with user ID 1000
34
  RUN useradd -m -u 1000 user
35
-
36
- # Switch to the "user" user
37
  USER user
38
-
39
- # Set home to the user's home directory
40
  ENV HOME=/home/user \
41
- PATH=/home/user/.local/bin:$PATH
42
-
43
- # Set the working directory to the user's home directory
44
- WORKDIR $HOME/app
45
-
46
- # Copy the current directory contents into the container at $HOME/app setting the owner to the user
47
- COPY --chown=user . $HOME/app
48
-
49
- ENV PYTHONUNBUFFERED=1 \
50
- GRADIO_ALLOW_FLAGGING=never \
51
- GRADIO_NUM_PORTS=1 \
52
- GRADIO_SERVER_NAME=0.0.0.0 \
53
- GRADIO_THEME=huggingface \
54
- SYSTEM=spaces
55
-
56
- CMD ["python3", "app.py"]
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM nvidia/cuda:12.4.0-devel-ubuntu22.04
 
 
 
 
 
 
 
 
2
  ENV DEBIAN_FRONTEND=noninteractive
3
+ RUN apt-get update && \
4
+ apt-get upgrade -y && \
5
+ apt-get install -y --no-install-recommends \
 
 
 
 
 
6
  git \
7
  git-lfs \
8
+ wget \
9
  curl \
10
+ # python build dependencies \
11
+ build-essential \
12
+ libssl-dev \
13
+ zlib1g-dev \
14
+ libbz2-dev \
15
+ libreadline-dev \
16
+ libsqlite3-dev \
17
+ libncursesw5-dev \
18
+ xz-utils \
19
+ tk-dev \
20
+ libxml2-dev \
21
+ libxmlsec1-dev \
22
+ libffi-dev \
23
+ liblzma-dev \
24
+ # gradio dependencies \
25
+ ffmpeg && \
26
+ apt-get clean && \
27
+ rm -rf /var/lib/apt/lists/*
28
 
 
29
  RUN useradd -m -u 1000 user
 
 
30
  USER user
 
 
31
  ENV HOME=/home/user \
32
+ PATH=/home/user/.local/bin:${PATH}
33
+ WORKDIR ${HOME}/app
34
+
35
+ RUN curl https://pyenv.run | bash
36
+ ENV PATH=${HOME}/.pyenv/shims:${HOME}/.pyenv/bin:${PATH}
37
+ ARG PYTHON_VERSION=3.10.16
38
+ RUN pyenv install ${PYTHON_VERSION} && \
39
+ pyenv global ${PYTHON_VERSION} && \
40
+ pyenv rehash && \
41
+ pip install --no-cache-dir -U pip setuptools wheel && \
42
+ pip install "huggingface-hub==0.27.1" "hf-transfer==0.1.9"
43
+
44
+ COPY --chown=1000 . ${HOME}/app
45
+ RUN pip install -r ${HOME}/app/requirements.txt
46
+
47
+ ENV PYTHONPATH=${HOME}/app \
48
+ PYTHONUNBUFFERED=1 \
49
+ HF_HUB_ENABLE_HF_TRANSFER=1 \
50
+ GRADIO_ALLOW_FLAGGING=never \
51
+ GRADIO_NUM_PORTS=1 \
52
+ GRADIO_SERVER_NAME=0.0.0.0 \
53
+ GRADIO_THEME=huggingface \
54
+ TQDM_POSITION=-1 \
55
+ TQDM_MININTERVAL=1 \
56
+ SYSTEM=spaces
57
+
58
+ CMD ["python", "app.py"]
app.py CHANGED
@@ -1,12 +1,14 @@
 
1
  import subprocess
2
- subprocess.run("pip install q8_kernels-0.0.0-cp39-cp39-linux_x86_64.whl".split())
 
 
3
 
4
  import gradio as gr
5
- from app_utils import prepare_pipeline, compute_hash
6
- import os
7
- from diffusers.utils import export_to_video
8
- import tempfile
9
  import torch
 
 
 
10
  from inference import load_text_encoding_pipeline
11
 
12
 
@@ -50,7 +52,7 @@ def generate_video_from_text(prompt, negative_prompt, seed, steps, guidance_scal
50
  max_sequence_length=max_sequence_length,
51
  generator=torch.manual_seed(seed),
52
  ).frames[0]
53
- out_path = tempfile.mkstemp(suffix=".mp4")
54
  export_to_video(video, out_path, fps=fps)
55
  return out_path
56
 
 
1
+ import shlex
2
  import subprocess
3
+ import tempfile
4
+
5
+ subprocess.run(shlex.split("pip install q8_kernels-0.0.0-cp310-cp310-linux_x86_64.whl"))
6
 
7
  import gradio as gr
 
 
 
 
8
  import torch
9
+ from diffusers.utils import export_to_video
10
+
11
+ from app_utils import prepare_pipeline, compute_hash
12
  from inference import load_text_encoding_pipeline
13
 
14
 
 
52
  max_sequence_length=max_sequence_length,
53
  generator=torch.manual_seed(seed),
54
  ).frames[0]
55
+ _, out_path = tempfile.mkstemp(suffix=".mp4")
56
  export_to_video(video, out_path, fps=fps)
57
  return out_path
58
 
q8_kernels-0.0.0-cp39-cp39-linux_x86_64.whl → q8_kernels-0.0.0-cp310-cp310-linux_x86_64.whl RENAMED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:abd90b0fdcb471d96dc1c931a8906567943f4a6ecfd68545f73722b442ac3d45
3
- size 4437017
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8062c34aee5b7a1e05b08c773afde0f886a61de48daeb423335e5108ec732f06
3
+ size 23500158
requirements.txt CHANGED
@@ -1,8 +1,8 @@
1
  git+https://github.com/huggingface/diffusers.git
2
- torch
3
  gradio
4
  gradio_toggle
5
  transformers
6
  accelerate
7
- imageio
8
- Pillow
 
1
  git+https://github.com/huggingface/diffusers.git
2
+ torch==2.4.0
3
  gradio
4
  gradio_toggle
5
  transformers
6
  accelerate
7
+ imageio[ffmpeg]
8
+ sentencepiece