graph_runner.py 446 Bytes
Newer Older
1
from lightx2v.utils.profiler import ProfilingContext4Debug
root's avatar
root committed
2
from loguru import logger
3
4
5
6
7
8
9
10


class GraphRunner:
    def __init__(self, runner):
        self.runner = runner
        self.compile()

    def compile(self):
root's avatar
root committed
11
        logger.info("start compile...")
12
13
        with ProfilingContext4Debug("compile"):
            self.runner.run_step()
root's avatar
root committed
14
        logger.info("end compile...")
15

helloyongyang's avatar
helloyongyang committed
16
17
    def run_pipeline(self):
        return self.runner.run_pipeline()