carlosDev1995 commited on
Commit
023d531
·
verified ·
1 Parent(s): 4254296

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -1,7 +1,8 @@
1
  import gradio as gr
2
- from simpletransformers.question_answering import QuestionAnsweringModel
3
 
4
  # Load model from training checkpoint
 
 
5
  model = QuestionAnsweringModel("bert", "./bert_outputs/bert/best_model", use_cuda=False)
6
 
7
  # Função para realizar predições
@@ -14,10 +15,10 @@ def perform_prediction(context, question):
14
  iface = gr.Interface(
15
  fn=perform_prediction,
16
  inputs=[
17
- gr.Textbox(placeholder="Insert context here...", label="Contexto"),
18
- gr.Textbox(placeholder="Ask a question about the context...", label="Pergunta")
19
  ],
20
- outputs=gr.Textbox(label="Response"),
21
  live=True,
22
  theme="compact",
23
  )
 
1
  import gradio as gr
 
2
 
3
  # Load model from training checkpoint
4
+ from simpletransformers.question_answering import QuestionAnsweringModel, QuestionAnsweringArgs
5
+
6
  model = QuestionAnsweringModel("bert", "./bert_outputs/bert/best_model", use_cuda=False)
7
 
8
  # Função para realizar predições
 
15
  iface = gr.Interface(
16
  fn=perform_prediction,
17
  inputs=[
18
+ gr.Textbox(placeholder="Insira o contexto aqui...", label="Contexto"),
19
+ gr.Textbox(placeholder="Faça uma pergunta sobre o contexto...", label="Pergunta")
20
  ],
21
+ outputs=gr.Textbox(label="Resposta"),
22
  live=True,
23
  theme="compact",
24
  )