Escuela_DS / app.py
VictorWittgenstein's picture
initial commit
07d3391
raw
history blame contribute delete
404 Bytes
# -*- coding: utf-8 -*-
"""
Created on Wed Jul 27 15:20:50 2022
@author: vblanco
"""
import gradio as gr
from transformers import pipeline
pipe = pipeline("fill-mask", model="dccuchile/bert-base-spanish-wwm-uncased")
def predict(text):
return pipe(text)['token_str']
iface = gr.Interface(
fn=predict,
inputs='text',
outputs='text',
examples=[["Hello! My [MASK] is Omar"]]
)
iface.launch()