    def spin(self, text: str) -> t.Generator[TaskID, None, None]:
        """Create a spinner as a context manager."""
        task_id = self.update(text, new=True)
        try:
            yield task_id
        finally:
            self._spinner_progress.remove_task(task_id)
            if self._spinner_task_id == task_id:
                self._spinner_task_id = None
Create a spinner as a context manager.
src/bentoml/_internal/cloud/base.py