Instructions to use aduzlo/zello-valid-trial-v3.2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Scikit-learn
How to use aduzlo/zello-valid-trial-v3.2 with Scikit-learn:
from huggingface_hub import hf_hub_download import joblib model = joblib.load( hf_hub_download("aduzlo/zello-valid-trial-v3.2", "sklearn_model.joblib") ) # only load pickle files from sources you trust # read more about it here https://skops.readthedocs.io/en/stable/persistence.html - Notebooks
- Google Colab
- Kaggle
Download handler.py from aduzlo/zello-valid-trial-v3.2: direct link, hf CLI and curl.
- Browser
- Download file 510 Bytes
-
https://huggingface.co/aduzlo/zello-valid-trial-v3.2/resolve/main/handler.py
- Command line
-
hf download hf://aduzlo/zello-valid-trial-v3.2/handler.py
-
curl -L -o handler.py https://huggingface.co/aduzlo/zello-valid-trial-v3.2/resolve/main/handler.py
510 Bytes
| from typing import Dict, List, Any | |
| import joblib | |
| import pandas as pd | |
| class EndpointHandler: | |
| def __init__(self, path=""): | |
| self.model = joblib.load(path + "/valid_trial_v3_2.joblib") | |
| def __call__(self, data: Dict[str, Any]) -> List[Any]: | |
| # get inputs | |
| s_in = data.pop("inputs", data) | |
| s_in = pd.Series(s_in) | |
| d_in = pd.DataFrame(s_in).transpose() | |
| # run normal prediction | |
| prediction = self.model.predict_proba(d_in)[:, 1] | |
| return prediction | |