edgilr commited on
Commit
08813b3
1 Parent(s): 4e9f64b

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -0
app.py ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from transformers import pipeline
2
+ import gradio as gr
3
+
4
+ translator = pipeline('text2text-generation', model='edgilr/mbart-neutralization')
5
+
6
+ def predict(txt):
7
+ return classifier(txt)[0]['label']
8
+
9
+ gr.Interface(fn=predict, inputs="text", outputs="text",
10
+ examples=['the story gives ample opportunity for large-scale action and suspense , which director shekhar kapur supplies with tremendous skill .',
11
+ 'the thing looks like a made-for-home-video quickie .']).launch(share=True)