Spaces:
Sleeping
Sleeping
edwardb1203
commited on
Commit
•
823db43
1
Parent(s):
46baab8
Update app.py
Browse files
app.py
CHANGED
@@ -1,12 +1,12 @@
|
|
1 |
-
from transformers import
|
2 |
import torch
|
3 |
import re
|
4 |
import gradio as gr
|
5 |
import os
|
6 |
import docx2txt
|
7 |
|
8 |
-
tokenizer =
|
9 |
-
model =
|
10 |
|
11 |
def summarize(text_file):
|
12 |
file_extension = os.path.splitext(text_file.name)[1]
|
|
|
1 |
+
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
|
2 |
import torch
|
3 |
import re
|
4 |
import gradio as gr
|
5 |
import os
|
6 |
import docx2txt
|
7 |
|
8 |
+
tokenizer = AutoTokenizer.from_pretrained("allenai/led-base-16384")
|
9 |
+
model = AutoModelForSeq2SeqLM.from_pretrained("checkpoint-64840").to("cuda").half()
|
10 |
|
11 |
def summarize(text_file):
|
12 |
file_extension = os.path.splitext(text_file.name)[1]
|