Spaces:
Sleeping
Sleeping
Chemsseddine
commited on
Commit
•
d5cd588
1
Parent(s):
a5996c5
Update app.py
Browse files
app.py
CHANGED
@@ -2,13 +2,13 @@ from transformers import RobertaTokenizerFast, EncoderDecoderModel
|
|
2 |
import torch
|
3 |
#initialisation de tokenizer
|
4 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
5 |
-
tokenizer = RobertaTokenizerFast.from_pretrained("Chemsseddine/bert2gpt2SUMM-finetuned-mlsum
|
6 |
#Chemsseddine/bert2gpt2SUMM-finetuned-mlsum
|
7 |
#aider les token special
|
8 |
tokenizer.bos_token = tokenizer.cls_token
|
9 |
tokenizer.eos_token = tokenizer.sep_token
|
10 |
#initialisation du modele
|
11 |
-
model = EncoderDecoderModel.from_pretrained("Chemsseddine/bert2gpt2SUMM-finetuned-mlsum
|
12 |
#tf.random.set_seed(0)
|
13 |
# generate summary
|
14 |
def generateSumm(input_texte,max,min):
|
|
|
2 |
import torch
|
3 |
#initialisation de tokenizer
|
4 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
5 |
+
tokenizer = RobertaTokenizerFast.from_pretrained("Chemsseddine/bert2gpt2SUMM-finetuned-mlsum")
|
6 |
#Chemsseddine/bert2gpt2SUMM-finetuned-mlsum
|
7 |
#aider les token special
|
8 |
tokenizer.bos_token = tokenizer.cls_token
|
9 |
tokenizer.eos_token = tokenizer.sep_token
|
10 |
#initialisation du modele
|
11 |
+
model = EncoderDecoderModel.from_pretrained("Chemsseddine/bert2gpt2SUMM-finetuned-mlsum").to(device)
|
12 |
#tf.random.set_seed(0)
|
13 |
# generate summary
|
14 |
def generateSumm(input_texte,max,min):
|