Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -116,18 +116,14 @@ vectordb = Chroma.from_documents(
|
|
116 |
persist_directory=persist_directory
|
117 |
)
|
118 |
# define retriever
|
119 |
-
|
120 |
retriever = vectordb.as_retriever(search_kwargs={"k": 2}, search_type="mmr")
|
121 |
|
122 |
class FinalAnswer(BaseModel):
|
123 |
question: str = Field(description="the original question")
|
124 |
answer: str = Field(description="the extracted answer")
|
125 |
|
126 |
-
#
|
127 |
-
|
128 |
-
|
129 |
-
# Crear una instancia de PydanticOutputParser con final_answer_instance como argumento
|
130 |
-
parser = PydanticOutputParser(pydantic_object=final_answer_instance)
|
131 |
|
132 |
template = """
|
133 |
Your name is Greta and you are a recycling chatbot with the objective to anwer questions from user in English or Spanish /
|
|
|
116 |
persist_directory=persist_directory
|
117 |
)
|
118 |
# define retriever
|
|
|
119 |
retriever = vectordb.as_retriever(search_kwargs={"k": 2}, search_type="mmr")
|
120 |
|
121 |
class FinalAnswer(BaseModel):
|
122 |
question: str = Field(description="the original question")
|
123 |
answer: str = Field(description="the extracted answer")
|
124 |
|
125 |
+
# Assuming you have a parser for the FinalAnswer class
|
126 |
+
parser = PydanticOutputParser(pydantic_object=FinalAnswer)
|
|
|
|
|
|
|
127 |
|
128 |
template = """
|
129 |
Your name is Greta and you are a recycling chatbot with the objective to anwer questions from user in English or Spanish /
|