Skip to content

Commit de7c632

Browse files
authored
82 updates for huggingface spaces with gpu (#84)
* Make HF space based on Docker. * Don't try to copy requirements * Use pip * Install python * Install python-dev * Add user * Move apt-get * Use streamlit run * Try disabling XsrfProtection
1 parent 9666d83 commit de7c632

File tree

6 files changed

+27
-70
lines changed

6 files changed

+27
-70
lines changed

.github/workflows/sync_hf_space.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020

2121
- run: |
2222
cp demo/app.py hf-space/app.py
23-
cp demo/requirements.txt hf-space/requirements.txt
23+
cp demo/Dockerfile hf-space/Dockerfile
2424
2525
- run: |
2626
cd hf-space

Dockerfile

Lines changed: 0 additions & 29 deletions
This file was deleted.

demo/Dockerfile

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
FROM nvidia/cuda:12.2.2-cudnn8-devel-ubuntu22.04
2+
3+
RUN apt-get update && apt-get install --no-install-recommends -y \
4+
build-essential \
5+
python3.10 \
6+
python3.10-dev \
7+
python3-pip \
8+
git \
9+
&& apt-get clean && rm -rf /var/lib/apt/lists/*
10+
11+
RUN useradd -m -u 1000 user
12+
13+
USER user
14+
15+
ENV HOME=/home/user \
16+
PATH=/home/user/.local/bin:$PATH
17+
18+
WORKDIR $HOME/app
19+
20+
RUN pip3 install https://github.com/abetlen/llama-cpp-python/releases/download/v0.3.4-cu122/llama_cpp_python-0.3.4-cp310-cp310-linux_x86_64.whl
21+
RUN pip3 install document-to-podcast
22+
23+
COPY --chown=user . $HOME/app
24+
25+
EXPOSE 8501
26+
ENTRYPOINT ["streamlit", "run", "app.py", "--server.enableXsrfProtection", "false"]

demo/download_models.py

Lines changed: 0 additions & 13 deletions
This file was deleted.

demo/requirements.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

demo/run.sh

Lines changed: 0 additions & 26 deletions
This file was deleted.

0 commit comments

Comments
 (0)