Create app.py
Browse files
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)
|