Update app.py
Browse files
app.py
CHANGED
|
@@ -30,18 +30,13 @@ client = InferenceClient("google/mt5-small", token=os.getenv("HUGGINGFACEHUB_API
|
|
| 30 |
ranker = Reranker("answerdotai/answerai-colbert-small-v1", model_type='colbert')
|
| 31 |
|
| 32 |
def generate_text(context, query):
|
| 33 |
-
prompt = f"""
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
Pregunta:
|
| 41 |
-
{query}
|
| 42 |
-
|
| 43 |
-
Respuesta:
|
| 44 |
-
"""
|
| 45 |
response = client.text_generation(prompt=prompt, max_new_tokens=200)
|
| 46 |
return response.strip()
|
| 47 |
|
|
|
|
| 30 |
ranker = Reranker("answerdotai/answerai-colbert-small-v1", model_type='colbert')
|
| 31 |
|
| 32 |
def generate_text(context, query):
|
| 33 |
+
prompt = f"""Responde en espa帽ol. Bas谩ndote en el siguiente contexto contesta de forma clara y directa.
|
| 34 |
+
|
| 35 |
+
Contexto:
|
| 36 |
+
{context}
|
| 37 |
+
|
| 38 |
+
Pregunta: {query}
|
| 39 |
+
Respuesta:"""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 40 |
response = client.text_generation(prompt=prompt, max_new_tokens=200)
|
| 41 |
return response.strip()
|
| 42 |
|