We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
import lazyllm from lazyllm.module import ModuleBase from lazyllm import pipeline, warp, bind import time import random class ChildPipeline(ModuleBase): def __init__(self, return_trace: bool = False, **kwargs): super().__init__(return_trace=return_trace, **kwargs) self.pipeline = self._build_pipeline(**kwargs) def _build_pipeline(self, **kwargs): with lazyllm.save_pipeline_result(): with pipeline() as ppl: ppl.bug = lambda x: time.sleep(random.randint(0, 30)) ppl.for_output = lazyllm.ifs(lambda x, y: y is None, lambda x, y: x, lambda x, y: y) | bind(ppl.input["idx"], lazyllm._0) return ppl def forward(self, test_data: dict, **kwargs): res = self.pipeline(test_data) return res class ParentPipeline(ModuleBase): childpipeline = ChildPipeline() def __init__(self, return_trace: bool = False, **kwargs): super().__init__(return_trace=return_trace, **kwargs) self.pipeline = self._build_pipeline(**kwargs) def _build_pipeline(self, **kwargs): with pipeline() as ppl: ppl.bug = warp(self.childpipeline).aslist return ppl def forward(self, test_data, **kwargs): res = self.pipeline(test_data) return res if __name__ == "__main__": ppl = ParentPipeline() test_data = [] for i in range(30): test_data.append({"idx": i}) res = ppl.forward(test_data) print("期望:", list(range(30))) print("实际:", res)
第一位出现不符合预期的情况(每次随机出现,应该与randint有关) 倒数第三位不符合预期
去掉save_pipeline_result后输出符合预期
lazyllm 0.2.3 Python 3.10.14
The text was updated successfully, but these errors were encountered:
此问题是save_pipeline_result和warp不兼容所致,会尽快修复
Sorry, something went wrong.
临时方案: #378 能支持warp里面套pipeline,但多套几次就不行了,比如warp(pipeline(warp(pipeline)))。之后给出系统的方案解决
No branches or pull requests
第一位出现不符合预期的情况(每次随机出现,应该与randint有关)
倒数第三位不符合预期
去掉save_pipeline_result后输出符合预期
lazyllm 0.2.3
Python 3.10.14
The text was updated successfully, but these errors were encountered: