From d7d38eece51387dfb9ef52759706ce90b22f106d Mon Sep 17 00:00:00 2001 From: SOULOFCINDER <841135647@qq.com> Date: Thu, 6 Apr 2023 17:03:04 +0800 Subject: [PATCH] update --- t5_large/Dockerfile | 9 ++++++++- t5_large/app.py | 4 ++-- t5_large/packages.txt | 2 ++ t5_large/requirements.txt | 1 + t5_large/t5-large | 1 - 5 files changed, 13 insertions(+), 4 deletions(-) create mode 100644 t5_large/packages.txt delete mode 160000 t5_large/t5-large diff --git a/t5_large/Dockerfile b/t5_large/Dockerfile index 2f124b8..2711cbe 100644 --- a/t5_large/Dockerfile +++ b/t5_large/Dockerfile @@ -2,6 +2,10 @@ FROM public.ecr.aws/iflytek-open/cuda-go-python-base:11.6-1.17-3.9.13-ubuntu1804 +RUN sed -i 's@//.*archive.ubuntu.com@//mirrors.ustc.edu.cn@g' /etc/apt/sources.list +RUN sed -i 's/security.ubuntu.com/mirrors.ustc.edu.cn/g' /etc/apt/sources.list + +RUN --mount=target=/root/packages.txt,source=packages.txt apt-get update && xargs -r -a /root/packages.txt apt-get install -y && rm -rf /var/lib/apt/lists/* WORKDIR /home/user/app RUN useradd -m -u 1000 user @@ -14,8 +18,11 @@ RUN pip config set global.index-url https://pypi.mirrors.ustc.edu.cn/simple/ RUN pip install --no-cache-dir pip==22.3.1 RUN --mount=target=requirements.txt,source=requirements.txt pip install --no-cache-dir -r requirements.txt - COPY --chown=1000 ./ /home/user/app +RUN curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash +RUN apt-get install git-lfs +RUN git lfs install +RUN git clone http://172.16.59.16:3000/huggingface/t5-large.git CMD ["python3", "app.py"] \ No newline at end of file diff --git a/t5_large/app.py b/t5_large/app.py index 221d9cf..1dc50dc 100644 --- a/t5_large/app.py +++ b/t5_large/app.py @@ -25,7 +25,7 @@ with gr.Blocks() as demo: gr.Markdown( """ # Translation:t5-large - Gradio Demo for t5-large. To use it, simply type in text, or click one of the examples to load them. + 这是t5-large的Gradio Demo。输入你想要的文本或者点击下面的示例来加载它。 """) with gr.Row(): text_input = gr.Textbox() @@ -34,4 +34,4 @@ with gr.Blocks() as demo: image_button.click(inference, inputs=text_input, outputs=text_output) gr.Examples(examples,inputs=text_input) -demo.launch() +demo.launch(server_name="0.0.0.0") diff --git a/t5_large/packages.txt b/t5_large/packages.txt new file mode 100644 index 0000000..b399c93 --- /dev/null +++ b/t5_large/packages.txt @@ -0,0 +1,2 @@ +git +curl \ No newline at end of file diff --git a/t5_large/requirements.txt b/t5_large/requirements.txt index 973b15c..5e5bf22 100644 --- a/t5_large/requirements.txt +++ b/t5_large/requirements.txt @@ -1,2 +1,3 @@ gradio==3.21.0 transformers==4.27.1 +torch==2.0.0 \ No newline at end of file diff --git a/t5_large/t5-large b/t5_large/t5-large deleted file mode 160000 index 6ed159b..0000000 --- a/t5_large/t5-large +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 6ed159b7a9408621a1ed0b9ca39aacc42c694d73