Skip to content
This repository has been archived by the owner on Sep 13, 2023. It is now read-only.

How to use callbacks #686

Open
dmpetrov opened this issue Jul 2, 2023 · 1 comment
Open

How to use callbacks #686

dmpetrov opened this issue Jul 2, 2023 · 1 comment
Assignees
Labels
apply Batch scoring and inferencing bug Something isn't working

Comments

@dmpetrov
Copy link
Member

dmpetrov commented Jul 2, 2023

I'm creating a callback "model":

>>> def pre(x: list) -> float: return x[0]*x[1]*x[2]*x[3]
>>> m = save(pre, "my_func1")

However, it cannot be applied to a dataframe d1-m:

$ mlem apply my_func d1-m --output of
⏳️ Loading data from d1-m.mlem
⏳️ Loading model from my_func.mlem
🍏 Applying `predict` method...
❌ Unexpected error: 'predict'
Use the --tb or --traceback option to include the traceback in the output
Please report it here: <https://github.com/iterative/mlem/issues>

How to do that properly?

@dmpetrov dmpetrov added the question Further information is requested label Jul 2, 2023
@aguschin aguschin self-assigned this Jul 3, 2023
@aguschin
Copy link
Contributor

aguschin commented Jul 12, 2023

@dmpetrov, it's

$ mlem apply my_func1 d1-m --output of --method __call__
⏳️ Loading data from d1-m.mlem
⏳️ Loading model from my_func1.mlem
🍏 Applying `__call__` method...
💾 Saving data to of.mlem

MLEM should use __call__ here by default.

@aguschin aguschin added bug Something isn't working apply Batch scoring and inferencing and removed question Further information is requested labels Jul 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
apply Batch scoring and inferencing bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants