Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -15,8 +15,7 @@ def generate_text(inp):
|
|
15 |
result=tln[item]
|
16 |
return result
|
17 |
#Gradio Interface
|
18 |
-
|
19 |
-
gr.Interface(generate_text,"textbox", output_text).launch(inline=False)
|
20 |
|
21 |
|
22 |
|
@@ -25,10 +24,10 @@ gr.Interface(generate_text,"textbox", output_text).launch(inline=False)
|
|
25 |
model = BartForConditionalGeneration.from_pretrained("facebook/bart-large-cnn")
|
26 |
tokenizer = BartTokenizer.from_pretrained("facebook/bart-large-cnn")
|
27 |
|
28 |
-
def article_summarization(
|
29 |
input_ = str(text) + ' </s>'
|
30 |
# generate summary
|
31 |
-
input_ids = tokenizer.encode(
|
32 |
summary_ids = model.generate(input_ids,
|
33 |
min_length=20,
|
34 |
max_length=12000)
|
|
|
15 |
result=tln[item]
|
16 |
return result
|
17 |
#Gradio Interface
|
18 |
+
|
|
|
19 |
|
20 |
|
21 |
|
|
|
24 |
model = BartForConditionalGeneration.from_pretrained("facebook/bart-large-cnn")
|
25 |
tokenizer = BartTokenizer.from_pretrained("facebook/bart-large-cnn")
|
26 |
|
27 |
+
def article_summarization(result):
|
28 |
input_ = str(text) + ' </s>'
|
29 |
# generate summary
|
30 |
+
input_ids = tokenizer.encode(result, return_tensors='pt')
|
31 |
summary_ids = model.generate(input_ids,
|
32 |
min_length=20,
|
33 |
max_length=12000)
|