Hi, I'm not sure to understand how QP perf work.
Indeed,
First Program: LLM1 takes 1min
Second Program: LLM1 takes 3min.
def get_query_pipeline(self):
"""Create & Return the Query Pipeline of database generation"""
qp = QP(
modules={
"input": InputComponent(),
"process_retriever": self.process_retriever_component,
"table_creation_prompt": self.table_creation_prompt,
"llm1": self.llm1,
"python_output_parser": self.python_parser_component,
},
verbose=True,
)
qp.add_link("input", "process_retriever")
qp.add_link("input", "table_creation_prompt", dest_key="query_str")
qp.add_link(
"process_retriever", "table_creation_prompt", dest_key="retrieved_nodes"
)
qp.add_chain(["table_creation_prompt", "llm1", "python_output_parser"])
return qp
VS
def get_query_pipeline(self):
"""Create & Return the Query Pipeline of database generation"""
qp = QP(
modules={
"input": InputComponent(),
"process_retriever": self.process_retriever_component,
"table_creation_prompt": self.table_creation_prompt,
"llm1": self.llm1,
"python_output_parser": self.python_parser_component,
"table_insert_prompt": self.table_insert_prompt,
"llm2": self.llm1,
"python_output_parser1": self.python_parser_component,
},
verbose=True,
)
qp.add_link("input", "process_retriever")
qp.add_link("input", "table_creation_prompt", dest_key="query_str")
qp.add_link(
"process_retriever", "table_creation_prompt", dest_key="retrieved_nodes"
)
qp.add_chain(["table_creation_prompt", "llm1", "python_output_parser"])
...
return qp