Skip to content

Commit 985b108

Browse files
committed
feat: add gradio docker
1 parent bbaf0cc commit 985b108

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

Docker/Gradio.Dockerfile

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Better use newer Python as generated code can use new features
2+
FROM python:3.10-slim
3+
4+
# install git, g++ and python3-tk
5+
RUN apt-get update && apt-get install -y git g++ python3-tk zip unzip procps r-base
6+
7+
# upgrade to latest pip
8+
RUN pip install --upgrade pip
9+
10+
RUN pip install gradio==4.31.0 gradio[oauth]
11+
# Add a new user "bigcodebenchuser"
12+
RUN adduser --disabled-password --gecos "" bigcodebenchuser
13+
14+
RUN rm -rf /bigcodebench
15+
16+
# Acquire benchmark code to local
17+
ADD "https://api.github.com/repos/bigcode-project/bigcodebench/commits?per_page=1" latest_commit
18+
RUN git clone https://github.com/bigcode-project/bigcodebench.git /bigcodebench
19+
20+
RUN cd /bigcodebench && pip install .
21+
22+
# Pre-install the dataset
23+
RUN python3 -c "from bigcodebench.data import get_bigcodebench; get_bigcodebench()"
24+
25+
RUN pip install -I --timeout 2000 -r https://github.com/bigcode-project/bigcodebench-annotation/releases/download/v0.1.0/requirements.txt
26+
27+
WORKDIR /app
28+
29+
RUN chown -R bigcodebenchuser:bigcodebenchuser /app
30+
31+
RUN chmod -R 777 /app
32+
33+
USER bigcodebenchuser
34+
35+
# ENTRYPOINT ["python", "app.py"]
36+
37+
# CMD ["sh", "-c", "pids=$(ps -u $(id -u) -o pid,comm | grep 'bigcodebench' | awk '{print $1}'); if [ -n \"$pids\" ]; then echo $pids | xargs -r kill; fi; rm -rf /tmp/*"]

0 commit comments

Comments
 (0)