Spaces:
Runtime error
Runtime error
jcmachicao
commited on
Commit
•
a8d2364
1
Parent(s):
ebffa0d
Update app.py
Browse files
app.py
CHANGED
@@ -31,7 +31,7 @@ if len(pregs)<3:
|
|
31 |
boton_preg = st.button('Enviar preguntas')
|
32 |
|
33 |
modelo_hf2 = 'mrm8488/distill-bert-base-spanish-wwm-cased-finetuned-spa-squad2-es'
|
34 |
-
|
35 |
#modelo_qa = AutoModelForQuestionAnswering.from_pretrained("mrm8488/bert-base-spanish-wwm-cased-finetuned-spa-squad2-es")
|
36 |
|
37 |
tokenizer = AutoTokenizer.from_pretrained("mrm8488/bert-base-spanish-wwm-cased-finetuned-spa-squad2-es",
|
@@ -44,7 +44,7 @@ tokenizer2 = AutoTokenizer.from_pretrained(modelo_hf2,
|
|
44 |
if boton_preg:
|
45 |
|
46 |
st.write('Procesando texto ', texto[0:50], '...')
|
47 |
-
preguntas = pipeline('question-answering', model=
|
48 |
for preg in pregs:
|
49 |
respuesta = preguntas({'question': preg, 'context': texto})
|
50 |
st.write(preg)
|
|
|
31 |
boton_preg = st.button('Enviar preguntas')
|
32 |
|
33 |
modelo_hf2 = 'mrm8488/distill-bert-base-spanish-wwm-cased-finetuned-spa-squad2-es'
|
34 |
+
modelo_qa = AutoModelForQuestionAnswering.from_pretrained(modelo_hf2)
|
35 |
#modelo_qa = AutoModelForQuestionAnswering.from_pretrained("mrm8488/bert-base-spanish-wwm-cased-finetuned-spa-squad2-es")
|
36 |
|
37 |
tokenizer = AutoTokenizer.from_pretrained("mrm8488/bert-base-spanish-wwm-cased-finetuned-spa-squad2-es",
|
|
|
44 |
if boton_preg:
|
45 |
|
46 |
st.write('Procesando texto ', texto[0:50], '...')
|
47 |
+
preguntas = pipeline('question-answering', model=modelo_qa, tokenizer=tokenizer2)
|
48 |
for preg in pregs:
|
49 |
respuesta = preguntas({'question': preg, 'context': texto})
|
50 |
st.write(preg)
|