SuperSecureHuman commited on
Commit
d76c37d
1 Parent(s): fe7109c

Create new file

Browse files
Files changed (1) hide show
  1. app.py +14 -0
app.py ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ from transformers import pipeline
3
+ import torch
4
+
5
+ torch.set_default_dtype(torch.float32)
6
+
7
+ summarizer = pipeline("summarization", model="facebook/bart-large-cnn")
8
+ print("Model Loaded")
9
+
10
+ def summarize(text):
11
+ return (summarizer(text, max_length=300, min_length=200, do_sample=False, num_workers=4))
12
+
13
+ iface = gr.Interface(fn=summarize, inputs="text", outputs="text")
14
+ iface.launch(debug=True)