Skip to content

Commit

Permalink
added upload of save_pretrained model
Browse files Browse the repository at this point in the history
  • Loading branch information
MarleneKress79789 committed Nov 29, 2023
1 parent 2299a8a commit cdcccc7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def upload_to_bucketfs(self) -> Path:
"""
Upload the downloaded models into the BucketFS
"""
return self._bucketfs_model_uploader.upload_directory(self._tmpdir_name)
return self._bucketfs_model_uploader.upload_directory(self._local_model_save_path / self._model_name)


class HuggingFaceHubBucketFSModelTransferSPFactory:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,3 +83,10 @@ def test_download_with_model():
#todo delete model


def test_upload_function_call():
test_setup = TestSetup()
test_setup.downloader.download_from_huggingface_hub_sp(model_factory=test_setup.model_factory_mock)
test_setup.reset_mocks()
model_save_path = (test_setup.downloader._local_model_save_path / test_setup.model_name)
test_setup.downloader.upload_to_bucketfs()
assert mock_cast(test_setup.bucketfs_model_uploader_mock.upload_directory).mock_calls == [call(model_save_path)]

0 comments on commit cdcccc7

Please sign in to comment.