Pendrokar commited on
Commit
ebb2014
1 Parent(s): 4c63992

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -0
app.py ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ from transformers import pipeline
3
+
4
+ pipeline = pipeline(task="emoji-prediction", model="Uberduck/torchmoji")
5
+
6
+ def predict(deepmoji_analysis):
7
+ predictions = pipeline(deepmoji_analysis)
8
+ return deepmoji_analysis, {p["label"]: p["score"] for p in predictions}
9
+
10
+ gradio_app = gr.Interface(fn=predict, inputs="text", outputs="text")
11
+
12
+ if __name__ == "__main__":
13
+ gradio_app.launch()