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

Refactoring/#146 use new model save functionality #186

Conversation

MarleneKress79789
Copy link
Collaborator

@MarleneKress79789 MarleneKress79789 commented Feb 6, 2024

All Submissions:

  • Is the title of the Pull Request correct?
  • Is the title of the corresponding issue correct?
  • Have you updated the changelog?
  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?
  • Are you mentioning the issue which this PullRequest fixes ("Fixes...")
  • Before you merge don't forget to run tests in AWS CodeBuild, by adding [CodeBuild] to the commit message
    Fixes Use new functions with save_pretrained for model loading #146

doc/user_guide/user_guide.md Show resolved Hide resolved
@@ -61,7 +60,7 @@ def upload_to_bucketfs(self) -> Path:

returns: Path of the uploaded model in the BucketFS
"""
return self._bucketfs_model_uploader.upload_directory(self._tmpdir_name / "pretrained" / self._model_name)
return self._bucketfs_model_uploader.upload_directory(self._tmpdir_name / "pretrained" / self._model_name) #todo should we do replace(-,_) here to?
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

where did we replace it befoe?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here:

def get_model_path(sub_dir: str, model_name: str) -> Path:

and then consequently here:

model_params.base_model, tmpdir / model_params.sub_dir / model_params.base_model.replace("-", "_")):

looks like there was concern about the path in bucketfs containing "-". but i dont know if that is still valid.

upload_model(bucketfs_location, model_name, download_tmpdir)
yield upload_tmpdir_name
upload_model(bucketfs_location, model_name, upload_tmpdir_name)
yield download_tmpdir
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this looks strange

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed upload_tempdir_name to upload_tempdir. if this is not what you meant please tell me.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no, I mean that we yield download_tmpdir is confusing me, I would yield the upload_tmpdir, but I might missunderstand something

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i know. especially since we dont change download_tmpdir, and then as far as i can see dont use it again after yielding. but when i tried removing it it broke. i cannot explain why

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, I will have a closer look

doc/user_guide/user_guide.md Outdated Show resolved Hide resolved
bucketfs_location = LocalFSMockBucketFSLocation(
PurePosixPath(upload_tmpdir))
upload_model(bucketfs_location, model_name, upload_tmpdir)
download_model(model_name, download_tmpdir)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, but the either change the function name or add a comment. because this does not even pretend to have anything to do with a "local bucketfs", its just saving the model locally.

@MarleneKress79789 MarleneKress79789 changed the base branch from main to dev_storage_format_change March 6, 2024 14:06
@MarleneKress79789 MarleneKress79789 merged commit 5f53bc2 into dev_storage_format_change Mar 7, 2024
4 checks passed
@MarleneKress79789 MarleneKress79789 deleted the refactoring/#146_use_new_model_save_functionality branch March 7, 2024 09:55
tkilias added a commit that referenced this pull request Apr 12, 2024
* switched use to huggingface transfer save pretrained version
* changed to load local model
* fix local bucketfs model upload
* removed download sample model fixture because of duplication
* documentation
* simplify upload_model_to_local_bucketfs in model_fixture.py 
* simplify implementation and improve naming in model_fixture.py 
* Remove .replace("-", "_") from model names

Co-authored-by: Torsten Kilias <[email protected]>
MarleneKress79789 added a commit that referenced this pull request Apr 12, 2024
* Refactoring/#146 use new model save functionality (#186)
* switched use to huggingface transfer save pretrained version
* changed to load local model
* removed download sample model fixture because of duplication
* #147: Removed huggingface token from model loading (#203)
* removed token_conn everywhere except model download and tests
* removed token_conn from relevant tests
* Documentation improvements (#199)
* Prepared release 1.0.0 (#206)

Co-authored-by: Torsten Kilias <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use new functions with save_pretrained for model loading
2 participants