Javedalam commited on
Commit
1ddbd5c
1 Parent(s): ca47e9b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -2
app.py CHANGED
@@ -1,6 +1,5 @@
1
 
2
 
3
- # Step 2: Import libraries
4
  import gradio as gr
5
  from transformers import pipeline
6
 
@@ -18,6 +17,14 @@ def summarize(text, model_name):
18
  return summary[0]['summary_text']
19
 
20
  # Step 4: Create the Gradio interface
 
 
 
 
 
 
 
 
21
  iface = gr.Interface(
22
  fn=summarize,
23
  inputs=[
@@ -26,7 +33,7 @@ iface = gr.Interface(
26
  ],
27
  outputs="textbox",
28
  title="Text Summarizer",
29
- description="Summarize text using various models from Hugging Face"
30
  )
31
 
32
  # Step 5: Launch the interface
 
1
 
2
 
 
3
  import gradio as gr
4
  from transformers import pipeline
5
 
 
17
  return summary[0]['summary_text']
18
 
19
  # Step 4: Create the Gradio interface
20
+ description = """
21
+ Summarize text using various models from Hugging Face:
22
+ - BART (facebook/bart-large-cnn)
23
+ - T5 (t5-small)
24
+ - Pegasus (google/pegasus-xsum)
25
+ - DistilBART (sshleifer/distilbart-cnn-12-6)
26
+ """
27
+
28
  iface = gr.Interface(
29
  fn=summarize,
30
  inputs=[
 
33
  ],
34
  outputs="textbox",
35
  title="Text Summarizer",
36
+ description=description
37
  )
38
 
39
  # Step 5: Launch the interface