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

Added Huggingface model transfer class with save_pretrained in download #158

Merged

Conversation

MarleneKress79789
Copy link
Collaborator

@MarleneKress79789 MarleneKress79789 commented Nov 29, 2023

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 #143

@MarleneKress79789 MarleneKress79789 force-pushed the feature/#143_Add_model_transfer_with_save_pretrained branch from be1b5c7 to c4f22e0 Compare November 29, 2023 12:26
@MarleneKress79789 MarleneKress79789 force-pushed the feature/#143_Add_model_transfer_with_save_pretrained branch from 39bce56 to cdcccc7 Compare November 29, 2023 12:53
…with_save_pretrained' into feature/#143_Add_model_transfer_with_save_pretrained
doc/changes/changes_0.7.0.md Show resolved Hide resolved
doc/changes/changes_0.7.0.md Show resolved Hide resolved
doc/changes/changes_0.7.0.md Show resolved Hide resolved


@runtime_checkable
class ModelFactoryProtocol(Protocol):
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think that got duplicated, extract from both files and use the same

self.bucketfs_location_mock.reset_mock()
self.temporary_directory_factory_mock.reset_mock()
self.model_factory_mock.reset_mock()
self.bucketfs_model_uploader_mock.reset_mock()
Copy link
Collaborator

Choose a reason for hiding this comment

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

self.bucketfs_model_uploader_factory_mock is missing

def test_download_function_call():
test_setup = TestSetup()
test_setup.downloader.download_from_huggingface_hub(model_factory=test_setup.model_factory_mock)
cache_dir = test_setup.temporary_directory_factory_mock.create().__enter__()
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
cache_dir = test_setup.temporary_directory_factory_mock.create().__enter__()
cache_dir = mock_cast(test_setup.temporary_directory_factory_mock.create().__enter__).return_value

Copy link
Collaborator

Choose a reason for hiding this comment

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

otherwise you are adding a call to the mocks mock_calls

test_setup = TestSetup()
test_setup.downloader.download_from_huggingface_hub(model_factory=test_setup.model_factory_mock)
cache_dir = test_setup.temporary_directory_factory_mock.create().__enter__()
model_save_path = (test_setup.downloader._tmpdir_name/"pretrained"/test_setup.model_name)
Copy link
Collaborator

Choose a reason for hiding this comment

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

spaces in path

Copy link
Collaborator

Choose a reason for hiding this comment

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

you should not access private attributes, why do you need it?

@kaklakariada kaklakariada dismissed tkilias’s stale review December 20, 2023 10:20

Team member currently not available, all findings are fixed.

@MarleneKress79789 MarleneKress79789 merged commit 237e4ae into main Dec 20, 2023
3 checks passed
@MarleneKress79789 MarleneKress79789 deleted the feature/#143_Add_model_transfer_with_save_pretrained branch December 20, 2023 10:32
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.

Add HuggingFaceHubBucketFSModelTransfer with save_pretrained
3 participants