-
Notifications
You must be signed in to change notification settings - Fork 66
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
feat: add artifact id and token endpoint #485
Conversation
finetuner/__init__.py
Outdated
def get_token() -> str: | ||
"""Get user token. | ||
|
||
This is a helper function to get token and pull artifact from cloud storage. |
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.
the docstring is confusing. This function does not download the artifact
finetuner/exception.py
Outdated
... | ||
|
||
|
||
class UserNotLoginError(Exception): |
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.
UserNotLoggedIn
finetuner/run.py
Outdated
status = self.status()[STATUS] | ||
if status in [CREATED, STARTED]: | ||
raise RunInProgressError( | ||
'The run needs to be finished in order to save the model.' |
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.
save the artifact
run_name=self._name, | ||
directory=directory, | ||
) | ||
|
||
def artifact_id(self): |
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 should be a property. Otherwise rename to get_artifact_id
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.
how about staus()
?
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.
well I think all should be properties 😛
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.
i believe status()
and logs()
should be get_
, the rest could be property
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.
having static ones as properties and non-statics with get_
makes sense to me, but I'm slightly leaning towards what George suggested because it looks simpler and more elegant
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.
LGTM!
run_name=self._name, | ||
directory=directory, | ||
) | ||
|
||
def artifact_id(self): |
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.
having static ones as properties and non-statics with get_
makes sense to me, but I'm slightly leaning towards what George suggested because it looks simpler and more elegant
This PR allows user to get user token from Hubble, and get artifact id once fine-tuning is done. Usage:
This allows user to directly pull artifact inside
FinetunerExecutor
usingtoken
andartifact
asartifact_id
.This PR also did some minor refactoring on
download_artifact
and error handling.A follow up PR will be created to update documentation including the usage of
FinetunerExecutor
.