yes2code commited on
Commit
b4d0042
·
1 Parent(s): 8a4de57

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +18 -4
app.py CHANGED
@@ -1,7 +1,21 @@
1
  import gradio as gr
2
 
3
- def greet(name):
4
- return "Hello " + name + "!!"
5
 
6
- iface = gr.Interface(fn=greet, inputs="text", outputs="text")
7
- iface.launch()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  import gradio as gr
2
 
3
+ #def greet(name):
4
+ # return "Hello " + name + "!!"
5
 
6
+ #iface = gr.Interface(fn=greet, inputs="text", outputs="text")
7
+ #iface.launch()
8
+
9
+ def summarize(input):
10
+ output = get_completion(input)
11
+ return output[0]['summary_text']
12
+
13
+ gr.close_all()
14
+ demo = gr.Interface(fn=summarize,
15
+ inputs=[gr.Textbox(label="Text to summarize", lines=6)],
16
+ outputs=[gr.Textbox(label="Result", lines=3)],
17
+ title="Text summarization with distilbart-cnn",
18
+ description="Summarize any text using the `shleifer/distilbart-cnn-12-6` model under the hood!"
19
+ )
20
+ demo.launch(share=True)
21
+ #demo.launch(share=True, server_port=int(os.environ['PORT2']))