jemsXDXD commited on
Commit
9d5618c
·
verified ·
1 Parent(s): 9fb19c4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -0
app.py CHANGED
@@ -1,5 +1,11 @@
1
  import gradio as gr
2
 
 
 
 
 
 
 
3
  contextos = {
4
  "How do I create an account?": "You can create an account by clicking on the 'Sign Up' button on our homepage. You will need to provide your email address, create a password, and fill in some basic information about yourself. An account will help you track your orders, manage your personal settings, and speed up future transactions.",
5
  "Which payment methods do you accept?": "We accept a wide range of payment methods including Visa, MasterCard, American Express, Discover, PayPal, and Apple Pay. You can also pay using store credit or gift cards issued by our company.",
 
1
  import gradio as gr
2
 
3
+ from transformers import pipeline
4
+ QA_modelo = pipeline('question-answering', model='deepset/roberta-base-squad2')
5
+
6
+ def obter_resposta(pergunta, contexto):
7
+ return QA_modelo(question=pergunta, context=contexto)
8
+
9
  contextos = {
10
  "How do I create an account?": "You can create an account by clicking on the 'Sign Up' button on our homepage. You will need to provide your email address, create a password, and fill in some basic information about yourself. An account will help you track your orders, manage your personal settings, and speed up future transactions.",
11
  "Which payment methods do you accept?": "We accept a wide range of payment methods including Visa, MasterCard, American Express, Discover, PayPal, and Apple Pay. You can also pay using store credit or gift cards issued by our company.",