Skip to content
New issue

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

Fix active run restart, zero top_p and other issues #240

Merged
merged 4 commits into from
Feb 26, 2025

Conversation

bonk1t
Copy link
Collaborator

@bonk1t bonk1t commented Feb 26, 2025

The main fix: NoneType has no attribute 'id' (self._run.id):

        try:
            actual_thread_id = thread_id or self.id
            actual_run_id = run_id or (self._run.id if self._run else None)

            if not actual_run_id:
                return  # Can't cancel without a run ID

            self._run = self.client.beta.threads.runs.cancel(
                thread_id=actual_thread_id, run_id=actual_run_id
            )
        except BadRequestError as e:
            if "Cannot cancel run with status" in e.message:
                self._run = self.client.beta.threads.runs.poll(
                    thread_id=actual_thread_id,
                    run_id=actual_run_id,
                    poll_interval_ms=500,
                )

@bonk1t bonk1t changed the title Fix active run restart Fix active run restart and other issues Feb 26, 2025
@bonk1t bonk1t changed the title Fix active run restart and other issues Fix active run restart, zero top_p and other issues Feb 26, 2025
@bonk1t bonk1t merged commit e1c896c into main Feb 26, 2025
1 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant