Instructions to use ModelForge/spam-classifier with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Scikit-learn
How to use ModelForge/spam-classifier with Scikit-learn:
from huggingface_hub import hf_hub_download import joblib model = joblib.load( hf_hub_download("ModelForge/spam-classifier", "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
| # .pyx is generated, so this is needed to make Cython compilation work | |
| _loss_cython_tree = [ | |
| fs.copyfile('_loss.pxd') | |
| ] | |
| _loss_pyx = custom_target( | |
| '_loss_pyx', | |
| output: '_loss.pyx', | |
| input: '_loss.pyx.tp', | |
| command: [py, tempita, '@INPUT@', '-o', '@OUTDIR@'], | |
| # TODO in principle this should go in py.exension_module below. This is | |
| # temporary work-around for dependency issue with .pyx.tp files. For more | |
| # details, see https://github.com/mesonbuild/meson/issues/13212 | |
| depends: _loss_cython_tree, | |
| ) | |
| py.extension_module( | |
| '_loss', | |
| _loss_pyx, | |
| dependencies: [openmp_dep], | |
| cython_args: cython_args, | |
| install: true, | |
| subdir: 'sklearn/_loss', | |
| ) | |