5w4n commited on
Commit
9cfd100
·
unverified ·
1 Parent(s): a57f878

Add custom dockerfile to override hf one

Browse files
Files changed (2) hide show
  1. Dockerfile +46 -0
  2. app.py +0 -1
Dockerfile ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.10
2
+
3
+ RUN apt-get update && apt-get install -y \
4
+ fakeroot && \
5
+ mv /usr/bin/apt-get /usr/bin/.apt-get && \
6
+ echo '#!/usr/bin/env sh\nfakeroot /usr/bin/.apt-get $@' > /usr/bin/apt-get && \
7
+ chmod +x /usr/bin/apt-get && \
8
+ rm -rf /var/lib/apt/lists/* && \
9
+ useradd -m -u 1000 user
10
+
11
+ WORKDIR /home/user/app
12
+
13
+ RUN apt-get update && apt-get install -y \
14
+ git \
15
+ git-lfs \
16
+ ffmpeg \
17
+ libsm6 \
18
+ libxext6 \
19
+ cmake \
20
+ rsync \
21
+ libgl1 \
22
+ && rm -rf /var/lib/apt/lists/* \
23
+ && git lfs install
24
+
25
+ RUN pip install --no-cache-dir pip==22.3.1 && \
26
+ pip install --no-cache-dir \
27
+ datasets \
28
+ "huggingface-hub>=0.19" "hf-transfer>=0.1.4" "protobuf<4" "click<8.1" "pydantic~=1.0"
29
+
30
+ COPY requirements.txt /tmp/requirements.txt
31
+ RUN pip install --no-cache-dir -r /tmp/requirements.txt
32
+
33
+ RUN pip install --no-cache-dir \
34
+ streamlit==1.34.0 \
35
+ "uvicorn>=0.14.0" \
36
+ spaces
37
+
38
+ RUN mkdir -p .streamlit && \
39
+ git config --global core.excludesfile ~/.gitignore && \
40
+ echo ".streamlit" > ~/.gitignore
41
+
42
+ COPY --chown=1000:1000 ./ /home/user/app
43
+
44
+ USER user
45
+
46
+ CMD ["streamlit", "run", "app.py", "--server.port=7860", "--server.address=0.0.0.0"]
app.py CHANGED
@@ -86,7 +86,6 @@ selected_text = reload_example_text_data("Burmese", selected_tokenizers)
86
  st.subheader(f"**Sampled Text:** `{selected_text}`")
87
  if st.button("🔄 New sample"):
88
  selected_text = reload_example_text_data("Burmese", selected_tokenizers)
89
- st.experimental_rerun()
90
  st.subheader("Number of Tokens")
91
  st.table(st.session_state.examplesdf)
92
 
 
86
  st.subheader(f"**Sampled Text:** `{selected_text}`")
87
  if st.button("🔄 New sample"):
88
  selected_text = reload_example_text_data("Burmese", selected_tokenizers)
 
89
  st.subheader("Number of Tokens")
90
  st.table(st.session_state.examplesdf)
91