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

The model name can't be found from config.json for skops models #136

Closed
merveenoyan opened this issue Nov 7, 2022 · 2 comments
Closed

Comments

@merveenoyan
Copy link
Contributor

merveenoyan commented Nov 7, 2022

I noticed for some skops models the inference API doesn't work so I wanted to debug it. It works for this one but not for this one (same behavior occurs on my local, as for widgets, model loading times out)

What happens when I send a request:

(base) ➜  ~ curl -X POST -d '{"data": {"attribute_0": ["material_7","material_3","material_2"],"attribute_1": ["material_8","material_8","material_6"],"attribute_2": ["5","5","6"],"attribute_3": ["8","8","9"],"loading": ["154.02","108.73","99.84"],"measurement_0" :["14","4","6"],"measurement_1": ["6","7","7"],"measurement_10": ["16.637","16.207","17.17"],"measurement_11": ["20.719","20.058","20.858"],"measurement_12": ["12.824","11.898","10.968"],"measurement_13": ["16.067","13.871","16.448"],"measurement_14": ["15.181","14.266","15.6"],"measurement_15": ["18.546","15.734","14.637"],"measurement_16": ["19.402","16.886","13.86"],"measurement_17": ["643.086","642.533","673.545"],"measurement_2": ["6","9","6"],"measurement_3": ["19.532","18.128","12"],"measurement_4": ["11.017","11.866","10.064"],"measurement_5": ["15.639","17.891","16.287"],"measurement_6": ["16.709","20.302","17.445"],"measurement_7": ["10.057","12","12.117"],"measurement_8": ["20.201","18.148","20.659"],"measurement_9": ["11.106","10.221","11.999"],"product_code": ["C","C","E"]}}' http://localhost:8000/
{"error":"An error occurred while loading the model: [Errno 2] No such file or directory: '/Users/mervenoyan/.cache/huggingface/hub/models--scikit-learn--tabular-playground/snapshots/a2caff2628a7b0d4ca7588c93cf44363d109f906/sklearn_model.joblib'"}          

Model file name, as specified in configuration file, is model.pkl so it should look for that and not for DEFAULT_FILENAME that is defined here.

Pinging @adrinjalali and @BenjaminBossan as they were interested.
I will dig into why it occurs for this model and fix it.

@osanseviero
Copy link
Member

osanseviero commented Nov 7, 2022

A way to debug this is to directly see what the model has in its information

from huggingface_hub import model_info
model_info("scikit-learn/Fish-Weight")
## vs
model_info("scikit-learn/tabular-playground")

You'll notice some differences in the config field

@merveenoyan
Copy link
Contributor Author

Ugh this is directly linked with #96 😂 The config is not parsed properly and that's why. I'm very tired of this, I think errors should be raised properly. Will propose a solution there.

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

No branches or pull requests

2 participants