| 611 | break |
| 612 | |
| 613 | def StopFineTune(self, request, context): |
| 614 | # We can't kill the Accelerate training loop mid-step cleanly from here; |
| 615 | # LocalAI's job manager kills the backend process on stop. The flag below |
| 616 | # at least lets the progress stream terminate quickly. |
| 617 | if self.active_job is not None and self.active_job.job_id == request.job_id: |
| 618 | self.active_job.stopped = True |
| 619 | self.active_job.progress_queue.put(None) |
| 620 | return backend_pb2.Result(success=True, message="OK") |
| 621 | |
| 622 | def _run_training(self, request, job): |
| 623 | try: |