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

Implementing Fallback Models for Tokenization #117

Merged
merged 1 commit into from
Jul 23, 2023
Merged

Conversation

okotek
Copy link
Contributor

@okotek okotek commented Jul 23, 2023

PR Type:
Enhancement


PR Description:
This PR introduces the ability to use fallback models for tokenization in the event that the primary model fails. It modifies the get_pr_diff and pr_generate_compressed_diff functions to accept a model parameter, and uses this parameter to determine the token limit. It also introduces a new function, retry_with_fallback_models, which attempts to generate a prediction with each model in a list until successful. The PR also updates various other functions and files to accommodate these changes.


PR Main Files Walkthrough:
-pr_agent/algo/pr_processing.py: Modified get_pr_diff and pr_generate_compressed_diff to accept a model parameter, and added retry_with_fallback_models function.
-pr_agent/algo/token_handler.py: Removed the limit attribute from the TokenHandler class.
-pr_agent/tools/pr_code_suggestions.py: Updated to use retry_with_fallback_models and pass the model to get_pr_diff.
-pr_agent/tools/pr_description.py: Updated to use retry_with_fallback_models and pass the model to get_pr_diff.
-pr_agent/tools/pr_information_from_user.py: Updated to use retry_with_fallback_models and pass the model to get_pr_diff.
-pr_agent/tools/pr_questions.py: Updated to use retry_with_fallback_models and pass the model to get_pr_diff.
-pr_agent/tools/pr_reviewer.py: Updated to use retry_with_fallback_models and pass the model to get_pr_diff.
-pr_agent/settings/configuration.toml: Added fallback-models configuration option.

@okotek okotek requested a review from mrT23 July 23, 2023 13:16
@okotek
Copy link
Contributor Author

okotek commented Jul 23, 2023

/describe

@github-actions
Copy link
Contributor

PR Analysis

  • 🎯 Main theme: Adding support for fallback models
  • 📌 Type of PR: Enhancement
  • 🧪 Relevant tests added: No
  • Focused PR: Yes, the PR is focused as it introduces a new feature of supporting fallback models in the application. All changes in the PR are related to this feature.
  • 🔒 Security concerns: No, the changes in this PR do not introduce any apparent security issues. However, it's always a good practice to ensure that any new models or data used by them are properly validated and sanitized.

PR Feedback

  • 💡 General PR suggestions: The PR is well-structured and the changes are consistent with the main theme. However, it would be beneficial to add some tests to ensure the new functionality works as expected. Also, it would be helpful to provide a description in the PR to give more context about the changes and how the fallback models are used.

How to use

To invoke the PR-Agent, add a comment using one of the following commands:
/review [-i]: Request a review of your Pull Request. For an incremental review, which only considers changes since the last review, include the '-i' option.
/describe: Modify the PR title and description based on the contents of the PR.
/improve: Suggest improvements to the code in the PR. These will be provided as pull request comments, ready to commit.
/ask <QUESTION>: Pose a question about the PR.

@github-actions github-actions bot changed the title Add support for fallback models Implementing Fallback Models for Tokenization Jul 23, 2023
@github-actions github-actions bot added the enhancement New feature or request label Jul 23, 2023
@okotek okotek merged commit 321f7bc into main Jul 23, 2023
1 check passed
@okotek okotek deleted the ok/fallback_models branch July 23, 2023 13:20
yochail pushed a commit to yochail/pr-agent that referenced this pull request Feb 11, 2024
Implementing Fallback Models for Tokenization
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants