SantosMD commited on
Commit
8644b63
·
verified ·
1 Parent(s): 34e8d4b

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +19 -0
app.py ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ from transformers import pipeline
3
+
4
+ # Carregar o modelo BioBERTpt
5
+ modelo = pipeline("fill-mask", model="pucpr/biobertpt-all")
6
+
7
+ def predição(texto):
8
+ resultado = modelo(texto)
9
+ return str(resultado)
10
+
11
+ interface = gr.Interface(
12
+ fn=predição,
13
+ inputs=gr.Textbox(lines=2, placeholder="Digite um texto com [MASK]"),
14
+ outputs="text",
15
+ title="API BioBERTpt",
16
+ description="Insira um texto com um token [MASK] para o modelo prever."
17
+ )
18
+
19
+ interface.launch()