Skip to content

Implement exception mechanism for final answer in remote executors #1429

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

Merged
merged 9 commits into from
Jun 26, 2025

Conversation

tobiasofsn
Copy link
Contributor

@tobiasofsn tobiasofsn commented Jun 10, 2025

Replaces regex-based final answer detection for remote executors with an exception-based mechanism, thereby fixing #1428.

This approach appears to be more robust to different ways of calling final_answer and is also more aligned with how final answer detection works for the local Python executor.

Fixes #1428.

@albertvillanova albertvillanova changed the title Exception mechanism for final answer for remote executors Implement exception mechanism for final answer in remote executors Jun 26, 2025
Copy link
Member

@albertvillanova albertvillanova left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!!!

I changed the implementation of the patching to support custom final answer tools.

@albertvillanova albertvillanova merged commit bb1c542 into huggingface:main Jun 26, 2025
3 checks passed
@tobiasofsn
Copy link
Contributor Author

Great work @albertvillanova!

@tobiasofsn tobiasofsn deleted the final-answer-exception branch June 26, 2025 13:55
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.

[BUG] Multiline final answer not detected
2 participants