From d17941d1caa027c2275c18369b435cd6c124a841 Mon Sep 17 00:00:00 2001 From: SOULOFCINDER <841135647@qq.com> Date: Thu, 6 Apr 2023 16:41:38 +0800 Subject: [PATCH] update --- twitter_roberta_base_sentiment/Dockerfile | 9 ++++++++- twitter_roberta_base_sentiment/app.py | 4 ++-- twitter_roberta_base_sentiment/packages.txt | 2 ++ 3 files changed, 12 insertions(+), 3 deletions(-) create mode 100644 twitter_roberta_base_sentiment/packages.txt diff --git a/twitter_roberta_base_sentiment/Dockerfile b/twitter_roberta_base_sentiment/Dockerfile index 2f124b8..1ea04b9 100644 --- a/twitter_roberta_base_sentiment/Dockerfile +++ b/twitter_roberta_base_sentiment/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/cardiffnlp/twitter-roberta-base-sentiment-latest.git CMD ["python3", "app.py"] \ No newline at end of file diff --git a/twitter_roberta_base_sentiment/app.py b/twitter_roberta_base_sentiment/app.py index a9206b1..628897c 100644 --- a/twitter_roberta_base_sentiment/app.py +++ b/twitter_roberta_base_sentiment/app.py @@ -34,7 +34,7 @@ def inference(text): title = "sentiment analysis:twitter-roberta-base-sentiment" -description = "Gradio Demo for twitter-roberta-base-sentiment. To use it, simply upload your image, or click one of the examples to load them." +description = "这是twitter-roberta-base-sentiment的Gradio Demo. 上传你想要的图像或者点击下面的示例来加载它。" article = "