Skip to main content

Python library for retrieving models from Faculty platform.

Project description

faculty-models is a tool to help you use models from the model registry in Faculty Platform.

Installation

faculty-models comes preinstalled in Python environments available in Faculty platform. To use it externally, install it from PyPI with pip:

pip install faculty-models

If you’ve not already done so on the computer you’re using, you’ll also need to generate and store CLI credentials for the Platform. You can do this with the Faculty CLI.

Usage

The model registry in Faculty Platform includes a feature that helps you generate the snippets you need. It will help you get the project and model IDs you need to use faculty-models.

If your model is in the MLmodel format (likely because you used MLflow to store it), you can load it directly back into Python with:

import faculty_models

model = faculty_models.load_mlmodel(
    project_id="998328c3-23df-4225-a3ee-0a53d1409fbd",
    model_id="c998fca9-e093-47ea-9896-8f75db695b91"
)

Otherwise, you can use the following to download the contents of the model to the local filesystem. download returns the path of the downloaded model files:

import faculty_models

path = faculty_models.download(
    project_id="998328c3-23df-4225-a3ee-0a53d1409fbd",
    model_id="c998fca9-e093-47ea-9896-8f75db695b91"
)

The above examples always download the latest version of a model. To get a specific verion, pass the version number when calling either function:

import faculty_models

model = faculty_models.load_mlmodel(
    project_id="998328c3-23df-4225-a3ee-0a53d1409fbd",
    model_id="c998fca9-e093-47ea-9896-8f75db695b91",
    version=4
)

If you only wish to download part of the model, or if you wish to load an MLmodel that is in a subdirectory of the model, pass the path argument to either function:

import faculty_models

model = faculty_models.load_mlmodel(
    project_id="998328c3-23df-4225-a3ee-0a53d1409fbd",
    model_id="c998fca9-e093-47ea-9896-8f75db695b91",
    path="sub/path"
)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

faculty-models-0.2.0.tar.gz (8.6 kB view details)

Uploaded Source

Built Distribution

faculty_models-0.2.0-py2.py3-none-any.whl (7.6 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file faculty-models-0.2.0.tar.gz.

File metadata

  • Download URL: faculty-models-0.2.0.tar.gz
  • Upload date:
  • Size: 8.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.3.1 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.2

File hashes

Hashes for faculty-models-0.2.0.tar.gz
Algorithm Hash digest
SHA256 0393fb4d8c714bf504d8852d68c03d43f4a51292be543d65dbca50e3ea29133a
MD5 45c6326a660e66ea4dcde57e8d933426
BLAKE2b-256 e51100b18024d4011bf95174bda332f9dae207c518e2313b2fe7739c308c4d46

See more details on using hashes here.

File details

Details for the file faculty_models-0.2.0-py2.py3-none-any.whl.

File metadata

  • Download URL: faculty_models-0.2.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 7.6 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.3.1 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.2

File hashes

Hashes for faculty_models-0.2.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 e7bbe8d605372b90bfc7fb811769ed1cdace953b5fd9eee1b14d0989112de854
MD5 d28903c6232c3a5f8ee12b2dbad1ef55
BLAKE2b-256 02372b0bb38fd8cd68cd826436b15a59fc8012dc571d84c148046e66010a87b1

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page