Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,26 +1,27 @@
|
|
1 |
-
import os
|
2 |
-
import sys
|
3 |
-
from transformers import pipeline
|
4 |
import gradio as gr
|
5 |
|
6 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7 |
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
title="Question Answering using RoBERTa",
|
23 |
-
inputs=[gr.inputs.Textbox(lines=15), "text"],
|
24 |
-
outputs=["text"],
|
25 |
-
examples=[["{}".format(passage), "{}".format(question)]])
|
26 |
-
iface.launch()
|
|
|
|
|
|
|
|
|
1 |
import gradio as gr
|
2 |
|
3 |
+
title = "RoBERTa, tengo una pregunta"
|
4 |
+
description = "Modelo tipo RoBERTa pre-entrenado por BSC-TeMU con la base de datos de la Bibliotecha Nacional de España y fine-tuned con el corpus SQAC (Spanish Question-Answering Corpus)."
|
5 |
+
examples = [
|
6 |
+
["¡Hola, mundo! Somos NLP en ES 🤗 la comunidad de hispanohablantes de la iniciativa “Languages at HuggingFace” y queremos democratizar el NLP en nuestro idioma. Somos una red internacional y nuestro objetivo es crear y compartir recursos que posibiliten y aceleren el avance del NLP en español.", "¿Quiénes somos?"]
|
7 |
+
]
|
8 |
+
article = """
|
9 |
+
<p style="text-align: center">
|
10 |
+
NLP en ES 🤗 | <a target=”_blank” href="https://nlp-en-es.org"> nlp-en-es.org </a>
|
11 |
+
</p>
|
12 |
+
"""
|
13 |
|
14 |
+
gr.Interface.load(
|
15 |
+
name="huggingface/Evelyn18/roberta-base-bne-ROBERTaBECAS",
|
16 |
+
inputs=[gr.inputs.Textbox(label="Contexto", lines=5), gr.inputs.Textbox(label="Pregunta")],
|
17 |
+
outputs=gr.outputs.Textbox(label="Respuesta"),
|
18 |
+
title=title,
|
19 |
+
description=description,
|
20 |
+
article=article,
|
21 |
+
examples=examples,
|
22 |
+
theme="huggingface",
|
23 |
+
allow_screenshot=True,
|
24 |
+
allow_flagging=True,
|
25 |
+
flagging_dir="flagged",
|
26 |
+
enable_queue=True
|
27 |
+
).launch()
|
|
|
|
|
|
|
|
|
|