From 269f0ea664e0ba9b8f1951146b75319467b594da Mon Sep 17 00:00:00 2001 From: songw Date: Wed, 12 Apr 2023 18:51:56 +0800 Subject: [PATCH] add --- bart-large-cnn-samsum/Dockerfile | 10 ++++++++ bart-large-cnn-samsum/requirements.txt | 3 +++ bart-large-cnn/Dockerfile | 10 ++++++++ bart-large-cnn/requirements.txt | 3 +++ bart-large-mnli/Dockerfile | 10 ++++++++ bart-large-mnli/requirements.txt | 3 +++ bart-large-xsum-samsum/Dockerfile | 10 ++++++++ bart-large-xsum-samsum/requirements.txt | 3 +++ bert-base-uncased/Dockerfile | 10 ++++++++ bert-base-uncased/requirements.txt | 3 +++ bertweet-base-sentiment-analysis/Dockerfile | 10 ++++++++ .../requirements.txt | 3 +++ blip-image-captioning-base/Dockerfile | 10 ++++++++ blip-image-captioning-base/requirements.txt | 4 ++++ blip-image-captioning-large/Dockerfile | 10 ++++++++ blip-image-captioning-large/requirements.txt | 4 ++++ blip-vqa-base/Dockerfile | 10 ++++++++ blip-vqa-base/requirements.txt | 4 ++++ blip-vqa-capfilt-large/Dockerfile | 10 ++++++++ blip-vqa-capfilt-large/requirements.txt | 4 ++++ blip2-opt-2.7b/Dockerfile | 10 ++++++++ blip2-opt-2.7b/requirements.txt | 4 ++++ chatgpt-prompts-bart-long/Dockerfile | 10 ++++++++ chatgpt-prompts-bart-long/requirements.txt | 4 +++- deberta-large-mnli-zero-cls/Dockerfile | 10 ++++++++ deberta-large-mnli-zero-cls/requirements.txt | 3 +++ distilbart-cnn-12-6/Dockerfile | 10 ++++++++ distilbart-cnn-12-6/requirements.txt | 4 ++++ distilbart-mnli-12-1/Dockerfile | 10 ++++++++ distilbart-mnli-12-1/requirements.txt | 3 +++ distilbart-mnli-12-3/Dockerfile | 10 ++++++++ distilbart-mnli-12-3/requirements.txt | 3 +++ .../Dockerfile | 10 ++++++++ .../app.py | 24 +++++++++++++++++++ .../requirements.txt | 3 +++ distilbert-base-uncased-mnli/Dockerfile | 10 ++++++++ distilbert-base-uncased-mnli/requirements.txt | 3 +++ 37 files changed, 264 insertions(+), 1 deletion(-) create mode 100644 bart-large-cnn-samsum/Dockerfile create mode 100644 bart-large-cnn-samsum/requirements.txt create mode 100644 bart-large-cnn/Dockerfile create mode 100644 bart-large-cnn/requirements.txt create mode 100644 bart-large-mnli/Dockerfile create mode 100644 bart-large-mnli/requirements.txt create mode 100644 bart-large-xsum-samsum/Dockerfile create mode 100644 bart-large-xsum-samsum/requirements.txt create mode 100644 bert-base-uncased/Dockerfile create mode 100644 bert-base-uncased/requirements.txt create mode 100644 bertweet-base-sentiment-analysis/Dockerfile create mode 100644 bertweet-base-sentiment-analysis/requirements.txt create mode 100644 blip-image-captioning-base/Dockerfile create mode 100644 blip-image-captioning-base/requirements.txt create mode 100644 blip-image-captioning-large/Dockerfile create mode 100644 blip-image-captioning-large/requirements.txt create mode 100644 blip-vqa-base/Dockerfile create mode 100644 blip-vqa-base/requirements.txt create mode 100644 blip-vqa-capfilt-large/Dockerfile create mode 100644 blip-vqa-capfilt-large/requirements.txt create mode 100644 blip2-opt-2.7b/Dockerfile create mode 100644 blip2-opt-2.7b/requirements.txt create mode 100644 chatgpt-prompts-bart-long/Dockerfile create mode 100644 deberta-large-mnli-zero-cls/Dockerfile create mode 100644 deberta-large-mnli-zero-cls/requirements.txt create mode 100644 distilbart-cnn-12-6/Dockerfile create mode 100644 distilbart-cnn-12-6/requirements.txt create mode 100644 distilbart-mnli-12-1/Dockerfile create mode 100644 distilbart-mnli-12-1/requirements.txt create mode 100644 distilbart-mnli-12-3/Dockerfile create mode 100644 distilbart-mnli-12-3/requirements.txt create mode 100644 distilbert-base-uncased-finetuned-sst-2-english/Dockerfile create mode 100644 distilbert-base-uncased-finetuned-sst-2-english/app.py create mode 100644 distilbert-base-uncased-finetuned-sst-2-english/requirements.txt create mode 100644 distilbert-base-uncased-mnli/Dockerfile create mode 100644 distilbert-base-uncased-mnli/requirements.txt diff --git a/bart-large-cnn-samsum/Dockerfile b/bart-large-cnn-samsum/Dockerfile new file mode 100644 index 0000000..f53e5eb --- /dev/null +++ b/bart-large-cnn-samsum/Dockerfile @@ -0,0 +1,10 @@ +FROM python:3.8.13 + +WORKDIR /app + +COPY . /app + +RUN pip config set global.index-url https://pypi.mirrors.ustc.edu.cn/simple +RUN pip install -r requirements.txt + +CMD ["python", "app.py"] diff --git a/bart-large-cnn-samsum/requirements.txt b/bart-large-cnn-samsum/requirements.txt new file mode 100644 index 0000000..f8e1863 --- /dev/null +++ b/bart-large-cnn-samsum/requirements.txt @@ -0,0 +1,3 @@ +gradio +transformers +torch diff --git a/bart-large-cnn/Dockerfile b/bart-large-cnn/Dockerfile new file mode 100644 index 0000000..f53e5eb --- /dev/null +++ b/bart-large-cnn/Dockerfile @@ -0,0 +1,10 @@ +FROM python:3.8.13 + +WORKDIR /app + +COPY . /app + +RUN pip config set global.index-url https://pypi.mirrors.ustc.edu.cn/simple +RUN pip install -r requirements.txt + +CMD ["python", "app.py"] diff --git a/bart-large-cnn/requirements.txt b/bart-large-cnn/requirements.txt new file mode 100644 index 0000000..f8e1863 --- /dev/null +++ b/bart-large-cnn/requirements.txt @@ -0,0 +1,3 @@ +gradio +transformers +torch diff --git a/bart-large-mnli/Dockerfile b/bart-large-mnli/Dockerfile new file mode 100644 index 0000000..f53e5eb --- /dev/null +++ b/bart-large-mnli/Dockerfile @@ -0,0 +1,10 @@ +FROM python:3.8.13 + +WORKDIR /app + +COPY . /app + +RUN pip config set global.index-url https://pypi.mirrors.ustc.edu.cn/simple +RUN pip install -r requirements.txt + +CMD ["python", "app.py"] diff --git a/bart-large-mnli/requirements.txt b/bart-large-mnli/requirements.txt new file mode 100644 index 0000000..f8e1863 --- /dev/null +++ b/bart-large-mnli/requirements.txt @@ -0,0 +1,3 @@ +gradio +transformers +torch diff --git a/bart-large-xsum-samsum/Dockerfile b/bart-large-xsum-samsum/Dockerfile new file mode 100644 index 0000000..f53e5eb --- /dev/null +++ b/bart-large-xsum-samsum/Dockerfile @@ -0,0 +1,10 @@ +FROM python:3.8.13 + +WORKDIR /app + +COPY . /app + +RUN pip config set global.index-url https://pypi.mirrors.ustc.edu.cn/simple +RUN pip install -r requirements.txt + +CMD ["python", "app.py"] diff --git a/bart-large-xsum-samsum/requirements.txt b/bart-large-xsum-samsum/requirements.txt new file mode 100644 index 0000000..f8e1863 --- /dev/null +++ b/bart-large-xsum-samsum/requirements.txt @@ -0,0 +1,3 @@ +gradio +transformers +torch diff --git a/bert-base-uncased/Dockerfile b/bert-base-uncased/Dockerfile new file mode 100644 index 0000000..f53e5eb --- /dev/null +++ b/bert-base-uncased/Dockerfile @@ -0,0 +1,10 @@ +FROM python:3.8.13 + +WORKDIR /app + +COPY . /app + +RUN pip config set global.index-url https://pypi.mirrors.ustc.edu.cn/simple +RUN pip install -r requirements.txt + +CMD ["python", "app.py"] diff --git a/bert-base-uncased/requirements.txt b/bert-base-uncased/requirements.txt new file mode 100644 index 0000000..f8e1863 --- /dev/null +++ b/bert-base-uncased/requirements.txt @@ -0,0 +1,3 @@ +gradio +transformers +torch diff --git a/bertweet-base-sentiment-analysis/Dockerfile b/bertweet-base-sentiment-analysis/Dockerfile new file mode 100644 index 0000000..f53e5eb --- /dev/null +++ b/bertweet-base-sentiment-analysis/Dockerfile @@ -0,0 +1,10 @@ +FROM python:3.8.13 + +WORKDIR /app + +COPY . /app + +RUN pip config set global.index-url https://pypi.mirrors.ustc.edu.cn/simple +RUN pip install -r requirements.txt + +CMD ["python", "app.py"] diff --git a/bertweet-base-sentiment-analysis/requirements.txt b/bertweet-base-sentiment-analysis/requirements.txt new file mode 100644 index 0000000..f8e1863 --- /dev/null +++ b/bertweet-base-sentiment-analysis/requirements.txt @@ -0,0 +1,3 @@ +gradio +transformers +torch diff --git a/blip-image-captioning-base/Dockerfile b/blip-image-captioning-base/Dockerfile new file mode 100644 index 0000000..f53e5eb --- /dev/null +++ b/blip-image-captioning-base/Dockerfile @@ -0,0 +1,10 @@ +FROM python:3.8.13 + +WORKDIR /app + +COPY . /app + +RUN pip config set global.index-url https://pypi.mirrors.ustc.edu.cn/simple +RUN pip install -r requirements.txt + +CMD ["python", "app.py"] diff --git a/blip-image-captioning-base/requirements.txt b/blip-image-captioning-base/requirements.txt new file mode 100644 index 0000000..c77de10 --- /dev/null +++ b/blip-image-captioning-base/requirements.txt @@ -0,0 +1,4 @@ +gradio +transformers +torch +Pillow diff --git a/blip-image-captioning-large/Dockerfile b/blip-image-captioning-large/Dockerfile new file mode 100644 index 0000000..f53e5eb --- /dev/null +++ b/blip-image-captioning-large/Dockerfile @@ -0,0 +1,10 @@ +FROM python:3.8.13 + +WORKDIR /app + +COPY . /app + +RUN pip config set global.index-url https://pypi.mirrors.ustc.edu.cn/simple +RUN pip install -r requirements.txt + +CMD ["python", "app.py"] diff --git a/blip-image-captioning-large/requirements.txt b/blip-image-captioning-large/requirements.txt new file mode 100644 index 0000000..c77de10 --- /dev/null +++ b/blip-image-captioning-large/requirements.txt @@ -0,0 +1,4 @@ +gradio +transformers +torch +Pillow diff --git a/blip-vqa-base/Dockerfile b/blip-vqa-base/Dockerfile new file mode 100644 index 0000000..f53e5eb --- /dev/null +++ b/blip-vqa-base/Dockerfile @@ -0,0 +1,10 @@ +FROM python:3.8.13 + +WORKDIR /app + +COPY . /app + +RUN pip config set global.index-url https://pypi.mirrors.ustc.edu.cn/simple +RUN pip install -r requirements.txt + +CMD ["python", "app.py"] diff --git a/blip-vqa-base/requirements.txt b/blip-vqa-base/requirements.txt new file mode 100644 index 0000000..c77de10 --- /dev/null +++ b/blip-vqa-base/requirements.txt @@ -0,0 +1,4 @@ +gradio +transformers +torch +Pillow diff --git a/blip-vqa-capfilt-large/Dockerfile b/blip-vqa-capfilt-large/Dockerfile new file mode 100644 index 0000000..f53e5eb --- /dev/null +++ b/blip-vqa-capfilt-large/Dockerfile @@ -0,0 +1,10 @@ +FROM python:3.8.13 + +WORKDIR /app + +COPY . /app + +RUN pip config set global.index-url https://pypi.mirrors.ustc.edu.cn/simple +RUN pip install -r requirements.txt + +CMD ["python", "app.py"] diff --git a/blip-vqa-capfilt-large/requirements.txt b/blip-vqa-capfilt-large/requirements.txt new file mode 100644 index 0000000..c77de10 --- /dev/null +++ b/blip-vqa-capfilt-large/requirements.txt @@ -0,0 +1,4 @@ +gradio +transformers +torch +Pillow diff --git a/blip2-opt-2.7b/Dockerfile b/blip2-opt-2.7b/Dockerfile new file mode 100644 index 0000000..f53e5eb --- /dev/null +++ b/blip2-opt-2.7b/Dockerfile @@ -0,0 +1,10 @@ +FROM python:3.8.13 + +WORKDIR /app + +COPY . /app + +RUN pip config set global.index-url https://pypi.mirrors.ustc.edu.cn/simple +RUN pip install -r requirements.txt + +CMD ["python", "app.py"] diff --git a/blip2-opt-2.7b/requirements.txt b/blip2-opt-2.7b/requirements.txt new file mode 100644 index 0000000..c77de10 --- /dev/null +++ b/blip2-opt-2.7b/requirements.txt @@ -0,0 +1,4 @@ +gradio +transformers +torch +Pillow diff --git a/chatgpt-prompts-bart-long/Dockerfile b/chatgpt-prompts-bart-long/Dockerfile new file mode 100644 index 0000000..f53e5eb --- /dev/null +++ b/chatgpt-prompts-bart-long/Dockerfile @@ -0,0 +1,10 @@ +FROM python:3.8.13 + +WORKDIR /app + +COPY . /app + +RUN pip config set global.index-url https://pypi.mirrors.ustc.edu.cn/simple +RUN pip install -r requirements.txt + +CMD ["python", "app.py"] diff --git a/chatgpt-prompts-bart-long/requirements.txt b/chatgpt-prompts-bart-long/requirements.txt index 755b092..fd372a0 100644 --- a/chatgpt-prompts-bart-long/requirements.txt +++ b/chatgpt-prompts-bart-long/requirements.txt @@ -1,3 +1,5 @@ -tensorflow +gradio transformers torch +Pillow +tensorflow diff --git a/deberta-large-mnli-zero-cls/Dockerfile b/deberta-large-mnli-zero-cls/Dockerfile new file mode 100644 index 0000000..f53e5eb --- /dev/null +++ b/deberta-large-mnli-zero-cls/Dockerfile @@ -0,0 +1,10 @@ +FROM python:3.8.13 + +WORKDIR /app + +COPY . /app + +RUN pip config set global.index-url https://pypi.mirrors.ustc.edu.cn/simple +RUN pip install -r requirements.txt + +CMD ["python", "app.py"] diff --git a/deberta-large-mnli-zero-cls/requirements.txt b/deberta-large-mnli-zero-cls/requirements.txt new file mode 100644 index 0000000..f8e1863 --- /dev/null +++ b/deberta-large-mnli-zero-cls/requirements.txt @@ -0,0 +1,3 @@ +gradio +transformers +torch diff --git a/distilbart-cnn-12-6/Dockerfile b/distilbart-cnn-12-6/Dockerfile new file mode 100644 index 0000000..f53e5eb --- /dev/null +++ b/distilbart-cnn-12-6/Dockerfile @@ -0,0 +1,10 @@ +FROM python:3.8.13 + +WORKDIR /app + +COPY . /app + +RUN pip config set global.index-url https://pypi.mirrors.ustc.edu.cn/simple +RUN pip install -r requirements.txt + +CMD ["python", "app.py"] diff --git a/distilbart-cnn-12-6/requirements.txt b/distilbart-cnn-12-6/requirements.txt new file mode 100644 index 0000000..c77de10 --- /dev/null +++ b/distilbart-cnn-12-6/requirements.txt @@ -0,0 +1,4 @@ +gradio +transformers +torch +Pillow diff --git a/distilbart-mnli-12-1/Dockerfile b/distilbart-mnli-12-1/Dockerfile new file mode 100644 index 0000000..f53e5eb --- /dev/null +++ b/distilbart-mnli-12-1/Dockerfile @@ -0,0 +1,10 @@ +FROM python:3.8.13 + +WORKDIR /app + +COPY . /app + +RUN pip config set global.index-url https://pypi.mirrors.ustc.edu.cn/simple +RUN pip install -r requirements.txt + +CMD ["python", "app.py"] diff --git a/distilbart-mnli-12-1/requirements.txt b/distilbart-mnli-12-1/requirements.txt new file mode 100644 index 0000000..f8e1863 --- /dev/null +++ b/distilbart-mnli-12-1/requirements.txt @@ -0,0 +1,3 @@ +gradio +transformers +torch diff --git a/distilbart-mnli-12-3/Dockerfile b/distilbart-mnli-12-3/Dockerfile new file mode 100644 index 0000000..f53e5eb --- /dev/null +++ b/distilbart-mnli-12-3/Dockerfile @@ -0,0 +1,10 @@ +FROM python:3.8.13 + +WORKDIR /app + +COPY . /app + +RUN pip config set global.index-url https://pypi.mirrors.ustc.edu.cn/simple +RUN pip install -r requirements.txt + +CMD ["python", "app.py"] diff --git a/distilbart-mnli-12-3/requirements.txt b/distilbart-mnli-12-3/requirements.txt new file mode 100644 index 0000000..f8e1863 --- /dev/null +++ b/distilbart-mnli-12-3/requirements.txt @@ -0,0 +1,3 @@ +gradio +transformers +torch diff --git a/distilbert-base-uncased-finetuned-sst-2-english/Dockerfile b/distilbert-base-uncased-finetuned-sst-2-english/Dockerfile new file mode 100644 index 0000000..f53e5eb --- /dev/null +++ b/distilbert-base-uncased-finetuned-sst-2-english/Dockerfile @@ -0,0 +1,10 @@ +FROM python:3.8.13 + +WORKDIR /app + +COPY . /app + +RUN pip config set global.index-url https://pypi.mirrors.ustc.edu.cn/simple +RUN pip install -r requirements.txt + +CMD ["python", "app.py"] diff --git a/distilbert-base-uncased-finetuned-sst-2-english/app.py b/distilbert-base-uncased-finetuned-sst-2-english/app.py new file mode 100644 index 0000000..577f4c7 --- /dev/null +++ b/distilbert-base-uncased-finetuned-sst-2-english/app.py @@ -0,0 +1,24 @@ +import gradio as gr +from transformers import pipeline, AutoTokenizer, AutoConfig, AutoModelForSequenceClassification + +modelName="distilbert-base-uncased-finetuned-sst-2-english" + +tokenizer = AutoTokenizer.from_pretrained(modelName) +model = AutoModelForSequenceClassification.from_pretrained(modelName) +sentimentPipeline = pipeline("sentiment-analysis", model=model, tokenizer=tokenizer) + +def sentiment_analysis(text): + results = sentimentPipeline(text) + + return f"Sentiment: {results[0].get('label')}, Score: {results[0].get('score'):.2f}" + +demo = gr.Interface(fn=sentiment_analysis, + inputs='text', + outputs='text', + title = "文本情感分析" + ) + + +if __name__ == "__main__": + demo.queue(concurrency_count=3) + demo.launch(server_name = "0.0.0.0", server_port = 7028) diff --git a/distilbert-base-uncased-finetuned-sst-2-english/requirements.txt b/distilbert-base-uncased-finetuned-sst-2-english/requirements.txt new file mode 100644 index 0000000..f8e1863 --- /dev/null +++ b/distilbert-base-uncased-finetuned-sst-2-english/requirements.txt @@ -0,0 +1,3 @@ +gradio +transformers +torch diff --git a/distilbert-base-uncased-mnli/Dockerfile b/distilbert-base-uncased-mnli/Dockerfile new file mode 100644 index 0000000..f53e5eb --- /dev/null +++ b/distilbert-base-uncased-mnli/Dockerfile @@ -0,0 +1,10 @@ +FROM python:3.8.13 + +WORKDIR /app + +COPY . /app + +RUN pip config set global.index-url https://pypi.mirrors.ustc.edu.cn/simple +RUN pip install -r requirements.txt + +CMD ["python", "app.py"] diff --git a/distilbert-base-uncased-mnli/requirements.txt b/distilbert-base-uncased-mnli/requirements.txt new file mode 100644 index 0000000..f8e1863 --- /dev/null +++ b/distilbert-base-uncased-mnli/requirements.txt @@ -0,0 +1,3 @@ +gradio +transformers +torch