Spaces:
Runtime error
Runtime error
Commit
·
a9bf681
1
Parent(s):
5e6da5f
Update app.py
Browse files
app.py
CHANGED
@@ -25,6 +25,7 @@ t5_tokenizer = AutoTokenizer.from_pretrained("mrm8488/t5-base-finetuned-summariz
|
|
25 |
def generate_text_summarization(sum_type,article):
|
26 |
if article.strip():
|
27 |
if sum_type == 'BART Extractive Text Summarization':
|
|
|
28 |
inputs = bart_extractive_tokenizer([article], max_length=1024, return_tensors='pt')
|
29 |
summary_ids = bart_extractive_model.generate(inputs['input_ids'], num_beams=4, min_length=60, max_length=300, early_stopping=True)
|
30 |
|
@@ -58,7 +59,7 @@ def generate_text_summarization(sum_type,article):
|
|
58 |
"score" : summary_score
|
59 |
}
|
60 |
|
61 |
-
save_data_and_sendmail(article, sum_type, summary)
|
62 |
return summary
|
63 |
else:
|
64 |
raise gr.Error("Please enter text in inputbox!!!!")
|
|
|
25 |
def generate_text_summarization(sum_type,article):
|
26 |
if article.strip():
|
27 |
if sum_type == 'BART Extractive Text Summarization':
|
28 |
+
print("text input :",article)
|
29 |
inputs = bart_extractive_tokenizer([article], max_length=1024, return_tensors='pt')
|
30 |
summary_ids = bart_extractive_model.generate(inputs['input_ids'], num_beams=4, min_length=60, max_length=300, early_stopping=True)
|
31 |
|
|
|
59 |
"score" : summary_score
|
60 |
}
|
61 |
|
62 |
+
# save_data_and_sendmail(article, sum_type, summary)
|
63 |
return summary
|
64 |
else:
|
65 |
raise gr.Error("Please enter text in inputbox!!!!")
|