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

chore: update JumpStart doc on listing models #4494

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 38 additions & 2 deletions doc/overview.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1440,8 +1440,7 @@ unique ID which can be used to retrieve the model URI. The following information

- ``model_id``: A unique identifier for the JumpStart model.
- ``model_version``: The version of the specifications for the
model. To use the latest version, enter ``"*"``. This is a
required parameter.
model. To use the latest version, enter ``"*"``.

To retrieve a model, first select a ``model ID`` and ``version`` from
the :doc:`available models <./doc_utils/pretrainedmodels>`.
Expand All @@ -1461,6 +1460,43 @@ Then use those values to retrieve the model as follows.
    model_id=model_id, model_version=model_version, model_scope=scope
)

There are utilities built-in to list the available models and their versions,

.. code:: python

from sagemaker.jumpstart import notebook_utils

notebook_utils.list_jumpstart_models(list_versions=True)

You can constuct custom filters to filter the list of models,

.. code:: python

from sagemaker.jumpstart import notebook_utils

# List Huggingface Large language models
filter_value = And("task == llm", "framework == huggingface")
notebook_utils.list_jumpstart_models(filter_value)

# List models that supports fine-tuning
filter_value = "training_supported == true"
notebook_utils.list_jumpstart_models(filter_value)

# List models based on search keywords
filter_value = "search_keywords includes Foundation Models"
notebook_utils.list_jumpstart_models(filter_value)

# List models based on supported instance types
filter_value = "supported_inference_instance_types includes ml.p4de.24xlarge"
notebook_utils.list_jumpstart_models(filter_value)

# List only publicly available models
notebook_utils.list_jumpstart_models("model_type == open_weights")

# List only proprietary models
notebook_utils.list_jumpstart_models("model_type == proprietary")


Model scripts
-------------

Expand Down
2 changes: 1 addition & 1 deletion src/sagemaker/jumpstart/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -1397,7 +1397,7 @@ def __init__(

self.model_id = model_id
self.model_version = model_version
self.model_type = (model_type,)
self.model_type = model_type
self.instance_type = instance_type
self.instance_count = instance_count
self.region = region
Expand Down
Loading