Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -3,10 +3,11 @@ import gradio as gr
|
|
| 3 |
|
| 4 |
# Use a pipeline as a high-level helper
|
| 5 |
from transformers import pipeline
|
| 6 |
-
|
| 7 |
# model_path = ("../Models/models--sshleifer--distilbart-cnn-12-6/snapshots/a4f8f3ea906ed274767e9906dbaede7531d660ff")
|
| 8 |
# text_summary = pipeline("summarization", model=model_path, torch_dtype=torch.bfloat16)
|
| 9 |
-
text_summary = pipeline("
|
|
|
|
| 10 |
# text='''Narendra Damodardas Modi[a] (born 17 September 1950) is an Indian politician who has served as the prime minister of India since 2014. Modi was the chief minister of Gujarat from 2001 to 2014 and is the member of parliament (MP) for Varanasi. He is a member of the Bharatiya Janata Party (BJP) and of the Rashtriya Swayamsevak Sangh (RSS), a right-wing Hindutva paramilitary volunteer organisation. He is the longest-serving prime minister outside the Indian National Congress.'''
|
| 11 |
# print(text_summary(text));
|
| 12 |
|
|
@@ -27,7 +28,7 @@ demo = gr.Interface(
|
|
| 27 |
["Narendra Damodardas Modi (born 17 September 1950) is an Indian politician..."],
|
| 28 |
["Artificial intelligence (AI) is intelligence demonstrated by machines..."]
|
| 29 |
],
|
| 30 |
-
|
| 31 |
)
|
| 32 |
|
| 33 |
demo.launch(theme=gr.themes.Soft())
|
|
|
|
| 3 |
|
| 4 |
# Use a pipeline as a high-level helper
|
| 5 |
from transformers import pipeline
|
| 6 |
+
#
|
| 7 |
# model_path = ("../Models/models--sshleifer--distilbart-cnn-12-6/snapshots/a4f8f3ea906ed274767e9906dbaede7531d660ff")
|
| 8 |
# text_summary = pipeline("summarization", model=model_path, torch_dtype=torch.bfloat16)
|
| 9 |
+
text_summary = pipeline("summarization", model="sshleifer/distilbart-cnn-12-6", torch_dtype=torch.bfloat16)
|
| 10 |
+
|
| 11 |
# text='''Narendra Damodardas Modi[a] (born 17 September 1950) is an Indian politician who has served as the prime minister of India since 2014. Modi was the chief minister of Gujarat from 2001 to 2014 and is the member of parliament (MP) for Varanasi. He is a member of the Bharatiya Janata Party (BJP) and of the Rashtriya Swayamsevak Sangh (RSS), a right-wing Hindutva paramilitary volunteer organisation. He is the longest-serving prime minister outside the Indian National Congress.'''
|
| 12 |
# print(text_summary(text));
|
| 13 |
|
|
|
|
| 28 |
["Narendra Damodardas Modi (born 17 September 1950) is an Indian politician..."],
|
| 29 |
["Artificial intelligence (AI) is intelligence demonstrated by machines..."]
|
| 30 |
],
|
| 31 |
+
|
| 32 |
)
|
| 33 |
|
| 34 |
demo.launch(theme=gr.themes.Soft())
|