Spaces:
Sleeping
Sleeping
Commit
·
fcc1ca4
1
Parent(s):
bdbcdce
dark
Browse files
app.py
CHANGED
@@ -20,45 +20,14 @@ The ship was on early Wednesday ordered to return to the Kai Tak Cruise Terminal
|
|
20 |
|
21 |
"""
|
22 |
|
23 |
-
|
24 |
sample_texts = [[text_1 ], [text_2]]
|
25 |
-
|
26 |
-
#desc = """
|
27 |
-
#<p style='text-align: center; color: linear-gradient(to top right,#ef4444, #fbbf24)'> </p>
|
28 |
-
#"""
|
29 |
desc = """
|
30 |
-
<
|
31 |
-
<head>
|
32 |
-
<style>
|
33 |
-
body {
|
34 |
-
background: rgb(39, 39, 39);
|
35 |
-
}
|
36 |
-
|
37 |
-
p {
|
38 |
-
background: linear-gradient(to top right,#ef4444 0%, #fbbf24 100%);
|
39 |
-
-webkit-text-fill-color: transparent;
|
40 |
-
-webkit-background-clip: text;
|
41 |
-
}
|
42 |
-
</style>
|
43 |
-
</head>
|
44 |
-
|
45 |
-
<body>
|
46 |
-
<p style='text-align: center>This is an abstractive text summarizer app using fine-tuned bart-large-cnn model. The abstractive approach involves rephrasing the complete document while capturing the complete meaning of the document. This type of summarization provides more human-like summary. Note: For faster summaries input smaller texts. Sample Text input is provided for you at the bottom!</p>
|
47 |
-
</body>
|
48 |
-
</html>
|
49 |
"""
|
50 |
|
51 |
|
52 |
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
model_name = "nikhedward/bart-large-cnn-finetuned-multi-news"
|
63 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
64 |
model = AutoModelForSeq2SeqLM.from_pretrained(model_name)
|
@@ -70,7 +39,7 @@ def summarize(inp):
|
|
70 |
summary = tokenizer.decode(summary_ids[0], skip_special_tokens=True)
|
71 |
return summary
|
72 |
|
73 |
-
interface = gr.Interface(fn=summarize, inputs=gr.inputs.Textbox(lines=10, label="Input Text"), description = desc, theme = "peach",
|
74 |
examples = sample_texts, title = title, outputs="text", css=".footer{display:none !important}")
|
75 |
|
76 |
interface.launch()
|
|
|
20 |
|
21 |
"""
|
22 |
|
|
|
23 |
sample_texts = [[text_1 ], [text_2]]
|
24 |
+
|
|
|
|
|
|
|
25 |
desc = """
|
26 |
+
<p style='text-align: center; color: #FF7F50'>This is an abstractive text summarizer app using fine-tuned bart-large-cnn model. The abstractive approach involves rephrasing the complete document while capturing the complete meaning of the document. This type of summarization provides more human-like summary. Note: For faster summaries input smaller texts. Sample Text input is provided for you at the bottom!</p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
27 |
"""
|
28 |
|
29 |
|
30 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
31 |
model_name = "nikhedward/bart-large-cnn-finetuned-multi-news"
|
32 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
33 |
model = AutoModelForSeq2SeqLM.from_pretrained(model_name)
|
|
|
39 |
summary = tokenizer.decode(summary_ids[0], skip_special_tokens=True)
|
40 |
return summary
|
41 |
|
42 |
+
interface = gr.Interface(fn=summarize, inputs=gr.inputs.Textbox(lines=10, label="Input Text"), description = desc, theme = "dark-peach",
|
43 |
examples = sample_texts, title = title, outputs="text", css=".footer{display:none !important}")
|
44 |
|
45 |
interface.launch()
|