joortif commited on
Commit
5c340bd
verified
1 Parent(s): 414482f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -12
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
- Contesta la siguiente pregunta bas谩ndote solo en el contexto proporcionado.
35
- Si no puedes encontrar la respuesta en el contexto, indica que no tienes suficiente informaci贸n.
36
-
37
- Contexto:
38
- {context}
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