Skip to content

Deprecate TextEnvironment and tools #3389

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 3 commits into from
Apr 29, 2025
Merged

Deprecate TextEnvironment and tools #3389

merged 3 commits into from
Apr 29, 2025

Conversation

lewtun
Copy link
Member

@lewtun lewtun commented Apr 29, 2025

What does this PR do?

This PR deprecates TextEnvironment and tools because:

  • Tools are being prioritised in smolagents
  • None of the examples currently work because the RL trainers are not yet set up for multi-step generation (the old PPOTrainer did because it was more modular)
  • A more generic API to support tool use would be better and require an overhaul anyway

Before submitting

  • This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
  • Did you read the contributor guideline,
    Pull Request section?
  • Was this discussed/approved via a GitHub issue? Please add a link
    to it if that's the case.
  • Did you make sure to update the documentation with your changes?
  • Did you write any new necessary tests?

Who can review?

Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.

@lewtun lewtun requested a review from qgallouedec April 29, 2025 11:29
@@ -241,6 +242,10 @@ def __init__(
max_length (Optional[int]): The maximum number of tokens to allow in an episode.
generation_kwargs (Optional[dict]): A dictionary of keyword arguments to pass to the model's generate method.
"""
warnings.warn(
"This class is deprecated and will be removed in version 0.21.0. To enable tool use with LLMs, check out smolagents (https://huggingface.co/docs/smolagents/index)",
Copy link
Member Author

Choose a reason for hiding this comment

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

Let me know if it should be a later version

Copy link
Member

Choose a reason for hiding this comment

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

0.21 looks good

@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@lewtun lewtun merged commit 01d0be1 into main Apr 29, 2025
10 checks passed
@lewtun lewtun deleted the deprecate-tools branch April 29, 2025 18:25
@AEJaspan
Copy link

AEJaspan commented May 9, 2025

Hi, is there any other way to explore RL with tool use that is currently being developed?

@lewtun
Copy link
Member Author

lewtun commented May 9, 2025

Hi @AEJaspan yes you can follow #3367

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.

4 participants