Upload 2 files
Browse files- Dockerfile +18 -23
- app.py +3 -2
Dockerfile
CHANGED
@@ -2,44 +2,39 @@ FROM python:3.8
|
|
2 |
|
3 |
WORKDIR /code
|
4 |
|
5 |
-
RUN wget https://registry.npmmirror.com/-/binary/node/latest-v16.x/node-v16.13.1-linux-x64.tar.gz \
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
RUN apt-get update \
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
RUN git clone https://github.com/ImageMagick/ImageMagick.git ImageMagick-7.1.1 \
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
|
24 |
COPY ./requriements.txt /code/requriements.txt
|
25 |
|
26 |
RUN pip install --no-cache-dir --upgrade -r /code/requriements.txt
|
27 |
|
28 |
|
29 |
-
|
30 |
RUN useradd -m -u 1000 user
|
31 |
|
32 |
-
# Switch to the "user" user
|
33 |
USER user
|
34 |
|
35 |
-
# Set home to the user's home directory
|
36 |
ENV HOME=/home/user \
|
37 |
PATH=/home/user/.local/bin:$PATH
|
38 |
|
39 |
-
# Set the working directory to the user's home directory
|
40 |
WORKDIR $HOME/app
|
41 |
|
42 |
-
# Copy the current directory contents into the container at $HOME/app setting the owner to the user
|
43 |
COPY --chown=user . $HOME/app
|
44 |
|
45 |
CMD ["python", "app.py"]
|
|
|
2 |
|
3 |
WORKDIR /code
|
4 |
|
5 |
+
# RUN wget https://registry.npmmirror.com/-/binary/node/latest-v16.x/node-v16.13.1-linux-x64.tar.gz \
|
6 |
+
# && tar -xvf node-v16.13.1-linux-x64.tar.gz \
|
7 |
+
# && mv node-v16.13.1-linux-x64 /usr/local/nodejs \
|
8 |
+
# && ln -s /usr/local/nodejs/bin/node /usr/local/bin \
|
9 |
+
# && ln -s /usr/local/nodejs/bin/npm /usr/local/bin \
|
10 |
+
# && node -v
|
11 |
+
|
12 |
+
# RUN apt-get update \
|
13 |
+
# && apt-get install -y texlive-full \
|
14 |
+
# && pdflatex -v
|
15 |
+
|
16 |
+
# RUN git clone https://github.com/ImageMagick/ImageMagick.git ImageMagick-7.1.1 \
|
17 |
+
# && cd ImageMagick-7.1.1 \
|
18 |
+
# && ./configure \
|
19 |
+
# && make \
|
20 |
+
# && make install \
|
21 |
+
# && ldconfig /usr/local/lib \
|
22 |
+
# && convert --version
|
23 |
|
24 |
COPY ./requriements.txt /code/requriements.txt
|
25 |
|
26 |
RUN pip install --no-cache-dir --upgrade -r /code/requriements.txt
|
27 |
|
28 |
|
|
|
29 |
RUN useradd -m -u 1000 user
|
30 |
|
|
|
31 |
USER user
|
32 |
|
|
|
33 |
ENV HOME=/home/user \
|
34 |
PATH=/home/user/.local/bin:$PATH
|
35 |
|
|
|
36 |
WORKDIR $HOME/app
|
37 |
|
|
|
38 |
COPY --chown=user . $HOME/app
|
39 |
|
40 |
CMD ["python", "app.py"]
|
app.py
CHANGED
@@ -298,12 +298,13 @@ def select_example3():
|
|
298 |
|
299 |
|
300 |
if __name__ == "__main__":
|
301 |
-
title = """<h1 align="center">
|
|
|
302 |
|
303 |
with gr.Blocks() as demo:
|
304 |
gr.Markdown(title)
|
305 |
|
306 |
-
gr.Button(value="Quick Try: type latex code of gt and pred, get metrics and visualization.", interactive=False, variant="primary")
|
307 |
|
308 |
with gr.Row():
|
309 |
with gr.Column():
|
|
|
298 |
|
299 |
|
300 |
if __name__ == "__main__":
|
301 |
+
title = """<h1 align="center">CDM: A Reliable Metric for Fair and Accurate Formula Recognition Evaluation</h1>
|
302 |
+
"""
|
303 |
|
304 |
with gr.Blocks() as demo:
|
305 |
gr.Markdown(title)
|
306 |
|
307 |
+
# gr.Button(value="Quick Try: type latex code of gt and pred, get metrics and visualization.", interactive=False, variant="primary")
|
308 |
|
309 |
with gr.Row():
|
310 |
with gr.Column():
|