Spaces:
Runtime error
Runtime error
Commit
·
6fa9846
1
Parent(s):
74899d4
Update app.py
Browse files
app.py
CHANGED
@@ -29,7 +29,7 @@ def summ_t5(text):
|
|
29 |
return summary_text
|
30 |
|
31 |
def summ_bert(text):
|
32 |
-
|
33 |
summary_ids= model_bert.generate(input_ids,
|
34 |
min_length=20,
|
35 |
max_length=100,
|
@@ -48,7 +48,7 @@ def summ_bert(text):
|
|
48 |
return summary_text
|
49 |
|
50 |
def para_t5(text):
|
51 |
-
|
52 |
outputs = t5_para_model.generate(
|
53 |
input_ids=encoding["input_ids"], attention_mask=encoding["attention_mask"],
|
54 |
max_length=512,
|
|
|
29 |
return summary_text
|
30 |
|
31 |
def summ_bert(text):
|
32 |
+
input_ids = tokenizer_bert(text, return_tensors="pt")
|
33 |
summary_ids= model_bert.generate(input_ids,
|
34 |
min_length=20,
|
35 |
max_length=100,
|
|
|
48 |
return summary_text
|
49 |
|
50 |
def para_t5(text):
|
51 |
+
encoding = t5_para_tokenizer.encode(text, padding='longest', return_tensors='pt')
|
52 |
outputs = t5_para_model.generate(
|
53 |
input_ids=encoding["input_ids"], attention_mask=encoding["attention_mask"],
|
54 |
max_length=512,
|