-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Feat/jsch jumpstart estimator support #4439
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
Merged
evakravi
merged 32 commits into
aws:master-jumpstart-curated-hub
from
bencrabtree:feat/jsch-model_estimator_support
Feb 26, 2024
Merged
Changes from 10 commits
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
032cb80
add hub and hubcontent support in retrieval function for jumpstart mo…
bencrabtree ef042d9
update types and var names
bencrabtree 49ae11b
update linter
bencrabtree 6175087
linter
bencrabtree 4c9b2d0
linter
bencrabtree 63345ea
flake8 check
bencrabtree 6efc206
add hub name support for jumpstart estimator
bencrabtree 2e9f76f
linter
bencrabtree ac8dd60
linter2
bencrabtree d4f7a00
fix param
bencrabtree 5492474
move to utils and test
bencrabtree 1e26760
feat: add hub and hubcontent support in retrieval function for jumpst…
bencrabtree 4ae201c
add hub and hubcontent support in retrieval function for jumpstart mo…
bencrabtree 4a19a33
update types and var names
bencrabtree 4d35379
update linter
bencrabtree 174c4fd
linter
bencrabtree b7a8835
linter
bencrabtree bb7a9fb
flake8 check
bencrabtree 8ba576a
pass hub_arn into all estimator utils/artifacts
bencrabtree ecd1f97
feat: add hub and hubcontent support in retrieval function for jumpst…
bencrabtree 8df4478
add hub and hubcontent support in retrieval function for jumpstart mo…
bencrabtree 4870c0b
update types and var names
bencrabtree 4dc21f5
update linter
bencrabtree dd51314
remove duplicate
bencrabtree 195b84b
Merge branch 'master-jumpstart-curated-hub' of https://github.com/aws…
bencrabtree a39ae5f
linter
bencrabtree 354b33e
add important unit test
bencrabtree 424254e
update tests
bencrabtree 8a3160a
black styles
bencrabtree 151350c
finish tests
bencrabtree dd087da
create curated hub utils and types
bencrabtree a61dfb4
fix linter
bencrabtree File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"). You | ||
# may not use this file except in compliance with the License. A copy of | ||
# the License is located at | ||
# | ||
# http://aws.amazon.com/apache2.0/ | ||
# | ||
# or in the "license" file accompanying this file. This file is | ||
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF | ||
# ANY KIND, either express or implied. See the License for the specific | ||
# language governing permissions and limitations under the License. | ||
"""This module provides the JumpStart Curated Hub class.""" | ||
from __future__ import absolute_import | ||
|
||
from typing import Optional, Dict, Any | ||
from sagemaker.jumpstart.constants import DEFAULT_JUMPSTART_SAGEMAKER_SESSION | ||
|
||
from sagemaker.session import Session | ||
|
||
|
||
class CuratedHub: | ||
bencrabtree marked this conversation as resolved.
Show resolved
Hide resolved
|
||
"""Class for creating and managing a curated JumpStart hub""" | ||
|
||
def __init__(self, hub_name: str, region: str, session: Optional[Session] = None): | ||
self.hub_name = hub_name | ||
self.region = region | ||
self.session = session | ||
self._sm_session = session or DEFAULT_JUMPSTART_SAGEMAKER_SESSION | ||
|
||
def describe_model(self, model_name: str, model_version: str = "*") -> Dict[str, Any]: | ||
"""Returns descriptive information about the Hub Model""" | ||
|
||
hub_content = self._sm_session.describe_hub_content( | ||
model_name, "Model", self.hub_name, model_version | ||
) | ||
|
||
# TODO: Parse HubContent | ||
# TODO: Parse HubContentDocument | ||
|
||
return hub_content | ||
|
||
def describe(self) -> Dict[str, Any]: | ||
"""Returns descriptive information about the Hub""" | ||
|
||
hub_info = self._sm_session.describe_hub(hub_name=self.hub_name) | ||
|
||
# TODO: Validations? | ||
|
||
return hub_info |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This assumed parsed HubContent. Suggest either explicitly commenting that or waiting for that implementation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a feature branch so I feel comfortable merging with out any of the implementation done, but yes this will be parsed. The
HubContentDocument
should be parsed at this point too