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 in src/autotrain/trainers/clm/utils.py in function #836

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Pragyan02
Copy link

Refactor process_data_with_chat_template to Improve Validation Data Handling

Description:

This pull request refactors the process_data_with_chat_template function to improve clarity and handling of the optional valid_data argument. Specifically, it ensures that valid_data can be passed as None without requiring manual initialization within the function.

Key Changes:

Optional Argument Handling:

  • Updated the valid_data argument to be optional (valid_data=None) in the function definition.
  • Removed the redundant initialization of valid_data to None within the function body.

Improved Readability:

  • Simplified the function signature by directly reflecting the optional nature of valid_data.
  • This improves the function's usability and makes the intent clearer when valid_data is not provided.

Unchanged Logic:

  • The core logic of the function remains intact. The chat template is applied to both train_data and valid_data if specified in the configuration.

@Pragyan02 Pragyan02 closed this Jan 3, 2025
@Pragyan02 Pragyan02 reopened this Jan 3, 2025
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