-
Notifications
You must be signed in to change notification settings - Fork 60
light fast removal of register_all_artifacts for unitxt classes #1939
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
ec9285d to
5af1edf
Compare
992e79c to
e4db288
Compare
|
Hi Dafna. Indeed the requirement to register classes is a cumbersome one. If I understand right, this proposed solution, searchs for a class in the unitxt folders. Unitxt allows extension in external catalogs and code, and people use it, so the search path to find classes is not only unitxt. I'm not sure how this approach can be extended to cover this. |
|
Thank you, @yoavkatz , this indeed is one missing piece of information for me: Where else is Will a high-level registration of such points of class-registration in the project directory do as a solution for the issue you raised? |
|
I think the way things worked before, is that once you imported a class, it registered it. Do if I extended unitxt and did from mymodule import MyMetric it would register MyMetric, and I load object that include MyMetric objects. If I did not have the import , I would get the error: my_metric is not a recognized artifact 'type'. Make sure a the class defined this type (Probably called 'MyMetric' or similar) is defined and/or imported anywhere in the code executed." |
|
Thank you, @yoavkatz , I need to exercise to understand. But at any rate, everything that runs today in main, also runs in the PR. The only thing that is gone from the code in this PR is the invocation of I apologize that I do not understand..: Is there another point in the code where All in all, this PR replaces the invocation of If I can understand whether and where another invocation of |
e4db288 to
16124e7
Compare
Signed-off-by: dafnapension <[email protected]>
Signed-off-by: dafnapension <[email protected]>
16124e7 to
80fba24
Compare
remove
register_all_artifactsfromunitxt.__init__. Instantiate classes upon demand (only the needed ones) by finding the module, and then use import tools.