Spaces:
Runtime error
Runtime error
Create app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from transformers import pipeline
|
| 2 |
+
import gradio as gr
|
| 3 |
+
pipe = pipeline("fill-mask", model="sagorsarker/bangla-bert-base")
|
| 4 |
+
|
| 5 |
+
|
| 6 |
+
def image_classifier(inp):
|
| 7 |
+
|
| 8 |
+
dat=pipe(inp)
|
| 9 |
+
suggested_word=[]
|
| 10 |
+
for x in dat:
|
| 11 |
+
suggested_word.append(x['token_str']+" "+str(x['score']))
|
| 12 |
+
return 'Word'+" "+'Perchantage\n'+'\n '.join(suggested_word)
|
| 13 |
+
|
| 14 |
+
|
| 15 |
+
demo = gr.Interface(fn=image_classifier,inputs="text", outputs="text")
|
| 16 |
+
demo.launch()
|