-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Top k value fix palm #609
Top k value fix palm #609
Conversation
WalkthroughThe changes primarily revolve around the modification of the Changes
TipsChat with CodeRabbit Bot (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review Status
Actionable comments generated: 1
Files selected for processing (3)
- pandasai/llm/base.py (2 hunks)
- test_file.txt (1 hunks)
- tests/llms/test_google_palm.py (2 hunks)
Files skipped from review due to trivial changes (1)
- test_file.txt
Additional comments (Suppressed): 3
tests/llms/test_google_palm.py (2)
37-48: The
top_k
parameter in thetest_params_setting
method has been updated from0.5
to50
. This change aligns with the PR summary, which states that the type oftop_k
has been changed fromfloat
toint
, and its default value is now set to40
. The test case should pass as long as theGooglePalm
class correctly handles the newtop_k
value.69-79: The range validation for
top_k
in thetest_validations
method has been modified from[0.0, 1.0]
to[0.0, 100.0]
. The negative value check fortop_k
is updated from-1
to-100
, and the upper limit check is changed from1.1
to110
. These changes are consistent with the PR summary and should ensure that theGooglePalm
class correctly validates thetop_k
parameter.pandasai/llm/base.py (1)
- 375-379: The type of
top_k
has been changed fromfloat
toint
, and its default value is now set to40
. Ensure that all calls to this function throughout the codebase have been updated to match the new signature. Also, verify if the change in the default value oftop_k
does not affect the existing functionality or performance.
if self.top_k is not None and not 0 <= self.top_k <= 100: | ||
raise ValueError("top_k must be in the range [0.0, 100.0]") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The validation range for top_k
has been updated from [0.0, 1.0]
to [0.0, 100.0]
. This change aligns with the update in the type and default value of top_k
. However, the error message still mentions the range as [0.0, 100.0]
which might be confusing since top_k
is now an integer. Consider updating the error message to reflect the correct range as [0, 100]
.
- raise ValueError("top_k must be in the range [0.0, 100.0]")
+ raise ValueError("top_k must be in the range [0, 100]")
@@ -0,0 +1 @@ | |||
Hello, world! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this file supposed to be here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mspronesti it's probably a easter egg from @Tanmaypatil123 😅
Removed it
Bug fix for older top_k value for google palm model.
Fixes :
Summary by CodeRabbit
Release Notes for Pull Request:
top_k
attribute in theBaseGoogle
class fromfloat
toint
, with a new default value of40
. This change will improve the precision of results.test_params_setting
andtest_validations
methods in the test suite to align with the updatedtop_k
attribute.test_file.txt
for debugging purposes.Please note that these changes are internal and should not affect end-user functionality.