Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -2,9 +2,6 @@ import torch
|
|
2 |
from transformers import BartTokenizer, BartForConditionalGeneration
|
3 |
import gradio as gr
|
4 |
from transformers import AutoTokenizer, AutoModelWithLMHead, TranslationPipeline
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
from transformers import pipeline
|
9 |
|
10 |
pipe= pipeline('text2text-generation', model="SEBIS/legal_t5_small_trans_fr_en")
|
@@ -16,11 +13,6 @@ def generate_text(inp):
|
|
16 |
return result
|
17 |
#Gradio Interface
|
18 |
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
model = BartForConditionalGeneration.from_pretrained("facebook/bart-large-cnn")
|
25 |
tokenizer = BartTokenizer.from_pretrained("facebook/bart-large-cnn")
|
26 |
|
@@ -38,6 +30,6 @@ def article_summarization(result):
|
|
38 |
|
39 |
#iface = gr.Interface(fn=article_summarization,title="Summarization in English",description="facebook/bart-large-cnn for summarization in English", inputs=(lines=50,['text']), outputs=["text"])
|
40 |
|
41 |
-
iface = gr.Interface(fn=article_summarization,title="Summarization in English",description="facebook/bart-large-cnn for summarization in English", inputs=gr.inputs.Textbox(lines=50, placeholder="Enter
|
42 |
|
43 |
iface.launch()
|
|
|
2 |
from transformers import BartTokenizer, BartForConditionalGeneration
|
3 |
import gradio as gr
|
4 |
from transformers import AutoTokenizer, AutoModelWithLMHead, TranslationPipeline
|
|
|
|
|
|
|
5 |
from transformers import pipeline
|
6 |
|
7 |
pipe= pipeline('text2text-generation', model="SEBIS/legal_t5_small_trans_fr_en")
|
|
|
13 |
return result
|
14 |
#Gradio Interface
|
15 |
|
|
|
|
|
|
|
|
|
|
|
16 |
model = BartForConditionalGeneration.from_pretrained("facebook/bart-large-cnn")
|
17 |
tokenizer = BartTokenizer.from_pretrained("facebook/bart-large-cnn")
|
18 |
|
|
|
30 |
|
31 |
#iface = gr.Interface(fn=article_summarization,title="Summarization in English",description="facebook/bart-large-cnn for summarization in English", inputs=(lines=50,['text']), outputs=["text"])
|
32 |
|
33 |
+
iface = gr.Interface(fn=article_summarization,title="Summarization in English",description="facebook/bart-large-cnn for summarization in English", inputs=gr.inputs.Textbox(lines=50, placeholder="Enter newspaper article to be summarized"))
|
34 |
|
35 |
iface.launch()
|