fix: better handling of extra model params in Harness#1183
Merged
chakravarthik27 merged 8 commits intorelease/2.6.0from Mar 7, 2025
Merged
Conversation
Prikshit7766
approved these changes
Mar 4, 2025
Contributor
There was a problem hiding this comment.
PR Overview
This PR enhances the handling of additional model parameters in the Harness by restructuring how extra model information is merged from both the configuration and per-model inputs.
- Restructures the merging of additional model info for models provided as a list.
- Consolidates the handling of model parameters from the configuration in both list and non-list branches.
Reviewed Changes
| File | Description |
|---|---|
| langtest/langtest.py | Refactors the merging logic of additional model info in the init method |
Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (1)
langtest/langtest.py:221
- [nitpick] Consider renaming the loop variable 'i' to a more descriptive name (e.g., 'model_entry') and avoid reassigning the 'model' variable inside the loop to improve clarity.
for i in model:
Contributor
There was a problem hiding this comment.
PR Overview
This PR improves the handling of additional model parameters in the Harness by restructuring how extra model information is merged and integrated.
- Introduces model-specific additional info extraction within a loop when multiple models are provided.
- Merges configuration parameters conditionally for each model based on its presence in the configuration.
- Maintains legacy behavior for single model scenarios while enhancing multi-model support.
Reviewed Changes
| File | Description |
|---|---|
| langtest/langtest.py | Revised init method to restructure merging of additional model information and handle multiple models |
Copilot reviewed 1 out of 1 changed files in this pull request and generated no comments.
Comments suppressed due to low confidence (2)
langtest/langtest.py:246
- The assignment to 'self.model' is done within the loop, causing repeated assignment on each iteration. Consider moving this assignment outside the loop to ensure it is set only once after processing all models.
self.model = model_dict
langtest/langtest.py:223
- [nitpick] Reassigning the 'model' variable within the loop can be confusing as it shadows the outer 'model' parameter. Consider using a different variable name to clarify the distinction between the loop item and the outer model.
model = i["model"]
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request includes changes to the
__init__method in thelangtest/langtest.pyfile to enhance the handling of additional model information. The most important changes include restructuring the way additional model information is merged and ensuring that model parameters from the configuration are properly integrated.Enhancements to model information handling:
langtest/langtest.py: Removed the old approach of merging additional model information and replaced it with a more structured way of handling additional info for each model. This includes filtering out specific keys and merging configuration parameters conditionally.