-
Notifications
You must be signed in to change notification settings - Fork 82
bug fixing : AttributeError: 'LifelongLearning' object has no attribute 'my_evaluate' #284 #286
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
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: katara-Jayprakash <[email protected]>
Signed-off-by: katara-Jayprakash <[email protected]>
Summary of ChangesHello @katara-Jayprakash, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request addresses a critical Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
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.
Code Review
This pull request aims to fix an AttributeError by renaming a method call from my_evaluate to evaluate. While this addresses the original error, the change introduces a critical NameError because the function now attempts to return variables that are no longer defined. My review includes a comment with a suggested fix to correctly handle the return values and prevent the new error, ensuring the function's contract with its callers is maintained.
| job = self.build_paradigm_job(ParadigmType.LIFELONG_LEARNING.value) | ||
| _, metric_func = get_metric_func(model_metric) | ||
| edge_task_index, tasks_detail, res = job.my_evaluate(eval_dataset, metrics=metric_func) | ||
| res = job.evaluate(eval_dataset, metrics=metric_func) |
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.
This change fixes the AttributeError by replacing job.my_evaluate with job.evaluate. However, it introduces a new critical bug. The my_eval function's return statement on line 423 (return edge_task_index, tasks_detail, res) will now fail with a NameError because the variables edge_task_index and tasks_detail are no longer defined within this function. Callers of my_eval (e.g., on line 108) expect all three return values.
If job.evaluate returns three values, the fix should be to unpack all of them. This would be a direct fix for the AttributeError while preserving the function's contract. If job.evaluate only returns a single value (as its usage in _eval suggests), then this function and its callers need a more significant refactoring to handle the missing values.
| res = job.evaluate(eval_dataset, metrics=metric_func) | |
| edge_task_index, tasks_detail, res = job.evaluate(eval_dataset, metrics=metric_func) |
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.
|
@abhishek-8081 is this pull request solved your issue? |
|
CI check is failing, please check. |
Fixes #284