rocioadlc commited on
Commit
c9279f9
1 Parent(s): d9532e3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -6
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
- # Crear una instancia de FinalAnswer
127
- final_answer_instance = FinalAnswer(question="What is your name?", answer="My name is GPT.")
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 /