def cleanup()

in llm_swarm/__init__.py [0:0]


    def cleanup(self, signum=None, frame=None):
        if self.config.debug_endpoint:
            return
        if self.cleaned_up:
            return
        for job_id in self.job_ids:
            run_command(f"scancel {job_id}")
        print("inference instances terminated")
        if self.container_id:
            run_command(f"sudo docker kill {self.container_id}")
            print("docker process terminated")
        self.cleaned_up = True