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(weave): fixed a bug where Evaluation.predict_and_score tried accessing __name__ #3071

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

Conversation

itay-verkh-lightricks
Copy link

…__ on a Callable instance

Description

Fixes #3070

What does the PR do? Include a concise description of the PR contents.

Added a check for whether the given callable to Evaluation.evaluate is a function. This prevents trying to access the __name__ attribute on an instance of Model, and the instance predict method is correctly picked by get_infer_method

Testing

Added a test in tests/trace/test_evaluate.py that defines a Model class with a __call__ method and runs an evaluation. Validated that if I remove my fix the test fails

@itay-verkh-lightricks itay-verkh-lightricks requested a review from a team as a code owner November 25, 2024 13:57
@circle-job-mirror
Copy link

This PR requires manual approval from a wandb user to run all CI checks.

To see the current diff, click here.

To approve CI for this PR as of this commit, comment:

/approve 2bb9393868502977ca5fadd19f286993816f6d35

Copy link
Contributor

CLA Assistant Lite bot:
Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.


I have read the CLA Document and I hereby sign the CLA


You can retrigger this bot by commenting recheck in this Pull Request

@itay-verkh-lightricks itay-verkh-lightricks changed the title fixed a bug where Evaluation.predict_and_score tried accessing __name fix a bug where Evaluation.predict_and_score tried accessing __name Nov 25, 2024
@itay-verkh-lightricks itay-verkh-lightricks changed the title fix a bug where Evaluation.predict_and_score tried accessing __name fix(weave) fixed a bug where Evaluation.predict_and_score tried accessing __name Nov 25, 2024
@itay-verkh-lightricks itay-verkh-lightricks changed the title fix(weave) fixed a bug where Evaluation.predict_and_score tried accessing __name fix(weave) fixed a bug where Evaluation.predict_and_score tried accessing __name__ Nov 25, 2024
@itay-verkh-lightricks itay-verkh-lightricks changed the title fix(weave) fixed a bug where Evaluation.predict_and_score tried accessing __name__ fix(weave): fixed a bug where Evaluation.predict_and_score tried accessing __name__ Nov 25, 2024
@circle-job-mirror
Copy link

circle-job-mirror bot commented Nov 25, 2024

@itay-verkh-lightricks
Copy link
Author

I have read the CLA Document and I hereby sign the CLA

@itay-verkh-lightricks
Copy link
Author

recheck

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.

AttributeError: '' object has no attribute '__name__' when giving a Callable model to Evaluation.evaluate()
1 participant