This commit is contained in:
songw 2023-04-12 18:51:56 +08:00
parent 493d3b4b0e
commit 269f0ea664
37 changed files with 264 additions and 1 deletions

View File

@ -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"]

View File

@ -0,0 +1,3 @@
gradio
transformers
torch

10
bart-large-cnn/Dockerfile Normal file
View File

@ -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"]

View File

@ -0,0 +1,3 @@
gradio
transformers
torch

View File

@ -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"]

View File

@ -0,0 +1,3 @@
gradio
transformers
torch

View File

@ -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"]

View File

@ -0,0 +1,3 @@
gradio
transformers
torch

View File

@ -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"]

View File

@ -0,0 +1,3 @@
gradio
transformers
torch

View File

@ -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"]

View File

@ -0,0 +1,3 @@
gradio
transformers
torch

View File

@ -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"]

View File

@ -0,0 +1,4 @@
gradio
transformers
torch
Pillow

View File

@ -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"]

View File

@ -0,0 +1,4 @@
gradio
transformers
torch
Pillow

10
blip-vqa-base/Dockerfile Normal file
View File

@ -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"]

View File

@ -0,0 +1,4 @@
gradio
transformers
torch
Pillow

View File

@ -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"]

View File

@ -0,0 +1,4 @@
gradio
transformers
torch
Pillow

10
blip2-opt-2.7b/Dockerfile Normal file
View File

@ -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"]

View File

@ -0,0 +1,4 @@
gradio
transformers
torch
Pillow

View File

@ -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"]

View File

@ -1,3 +1,5 @@
tensorflow
gradio
transformers
torch
Pillow
tensorflow

View File

@ -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"]

View File

@ -0,0 +1,3 @@
gradio
transformers
torch

View File

@ -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"]

View File

@ -0,0 +1,4 @@
gradio
transformers
torch
Pillow

View File

@ -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"]

View File

@ -0,0 +1,3 @@
gradio
transformers
torch

View File

@ -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"]

View File

@ -0,0 +1,3 @@
gradio
transformers
torch

View File

@ -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"]

View File

@ -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)

View File

@ -0,0 +1,3 @@
gradio
transformers
torch

View File

@ -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"]

View File

@ -0,0 +1,3 @@
gradio
transformers
torch