VictorWittgenstein commited on
Commit
07d3391
1 Parent(s): cf1d0e0

initial commit

Browse files
Files changed (1) hide show
  1. app.py +23 -0
app.py ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # -*- coding: utf-8 -*-
2
+ """
3
+ Created on Wed Jul 27 15:20:50 2022
4
+
5
+ @author: vblanco
6
+ """
7
+
8
+ import gradio as gr
9
+ from transformers import pipeline
10
+
11
+ pipe = pipeline("fill-mask", model="dccuchile/bert-base-spanish-wwm-uncased")
12
+
13
+ def predict(text):
14
+ return pipe(text)['token_str']
15
+
16
+ iface = gr.Interface(
17
+ fn=predict,
18
+ inputs='text',
19
+ outputs='text',
20
+ examples=[["Hello! My [MASK] is Omar"]]
21
+ )
22
+
23
+ iface.launch()