igoracmorais commited on
Commit
ebcd6e2
·
verified ·
1 Parent(s): 3fdeead

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -5,17 +5,17 @@ from transformers import pipeline
5
  qa = pipeline('question-answering')
6
 
7
  # criando a função para a interface
8
- def answer_question(context, question):
9
- resposta = qa(context=context, question=question)
10
  return resposta['answer']
11
 
12
  iface = gr.Interface(
13
  fn=answer_question,
14
  inputs=[
15
- gr.Textbox(type="text", label="Context"),
16
- gr.Textbox(type="text", label="Question")
17
  ],
18
- outputs=gr.Textbox(type="text", label="Answer")
19
  )
20
 
21
  iface.launch()
 
5
  qa = pipeline('question-answering')
6
 
7
  # criando a função para a interface
8
+ def answer_question(contexto, pergunta):
9
+ resposta = qa(context=contexto, question=pergunta)
10
  return resposta['answer']
11
 
12
  iface = gr.Interface(
13
  fn=answer_question,
14
  inputs=[
15
+ gr.Textbox(type="text", label="Contexto"),
16
+ gr.Textbox(type="text", label="Pergunta")
17
  ],
18
+ outputs=gr.Textbox(type="text", label="Resposta")
19
  )
20
 
21
  iface.launch()