Spaces:
Sleeping
Sleeping
GuysRGithub
commited on
Commit
•
6cef789
1
Parent(s):
401eb32
Fix
Browse files- Dockerfile +0 -2
- app.py +2 -6
Dockerfile
CHANGED
@@ -6,8 +6,6 @@ COPY ./requirements.txt /code/requirements.txt
|
|
6 |
|
7 |
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
|
8 |
|
9 |
-
RUN git clone https://huggingface.co/GuysTrans/bart-base-finetuned-xsum
|
10 |
-
|
11 |
COPY . .
|
12 |
|
13 |
CMD ["flask", "run", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
6 |
|
7 |
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
|
8 |
|
|
|
|
|
9 |
COPY . .
|
10 |
|
11 |
CMD ["flask", "run", "--host", "0.0.0.0", "--port", "7860"]
|
app.py
CHANGED
@@ -5,13 +5,9 @@ from huggingface_hub.hf_api import HfFolder
|
|
5 |
from transformers import AutoModelForSeq2SeqLM
|
6 |
from transformers import AutoTokenizer
|
7 |
|
8 |
-
|
9 |
|
10 |
-
|
11 |
-
model_name = model_checkpoint.split("/")[-1]
|
12 |
-
tokenizer = AutoTokenizer.from_pretrained(model_checkpoint)
|
13 |
-
|
14 |
-
model = AutoModelForSeq2SeqLM.from_pretrained(f"{model_name}-finetuned-xsum")
|
15 |
|
16 |
|
17 |
def generate_summary(question, model):
|
|
|
5 |
from transformers import AutoModelForSeq2SeqLM
|
6 |
from transformers import AutoTokenizer
|
7 |
|
8 |
+
tokenizer = AutoTokenizer.from_pretrained("facebook/bart-base")
|
9 |
|
10 |
+
model = AutoModelForSeq2SeqLM.from_pretrained("GuysTrans/bart-base-finetuned-xsum")
|
|
|
|
|
|
|
|
|
11 |
|
12 |
|
13 |
def generate_summary(question, model):
|