ok
Build-Deploy-Actions Details

This commit is contained in:
jianjiang 2023-04-21 18:47:32 +08:00
parent dbd558b3cd
commit 4fa9bdfe5f
3 changed files with 4 additions and 1 deletions

View File

@ -6,6 +6,6 @@ WORKDIR /app
COPY . /app COPY . /app
RUN pip config set global.index-url https://pypi.mirrors.ustc.edu.cn/simple RUN pip config set global.index-url https://pypi.mirrors.ustc.edu.cn/simple
#RUN pip install -r requirements.txt RUN pip install -r requirements.txt
CMD ["python", "app.py"] CMD ["python", "app.py"]

2
app.py
View File

@ -15,6 +15,8 @@ theme = gr.themes.Default(radius_size=sizes.radius_none).set(
) )
model_name = 'google/pegasus-cnn_dailymail' model_name = 'google/pegasus-cnn_dailymail'
#model_name = '/mnt/atpdata/models_hub/huggingface/summarization/google/pegasus-cnn_dailymail'
#model_name = '/models/pegasus-cnn_dailymail'
summarization_model = pipeline('summarization', model=model_name, tokenizer=model_name, device=0 if torch.cuda.is_available() else -1) summarization_model = pipeline('summarization', model=model_name, tokenizer=model_name, device=0 if torch.cuda.is_available() else -1)
def generate_abstractive_summary(text, type, min_len=120, max_len=512, **kwargs): def generate_abstractive_summary(text, type, min_len=120, max_len=512, **kwargs):

1
requirements.txt Normal file
View File

@ -0,0 +1 @@
protobuf==3.20.1