Spaces:
Runtime error
Runtime error
| # -*- 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() |