-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Fix model loading from S3 buckets #11865
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
Changes from all commits
4006dbf
0b4bb1c
f32b7c2
41d8f61
22caac0
058e9e3
36402e7
fd349a4
19e8b34
0722afc
785e8c3
bdbec79
cc38e63
032aa8b
a744052
c54f55d
b7a43b1
54298ef
8c49439
9b44356
36f4110
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -101,7 +101,9 @@ def pull_files( | |||||
| return | ||||||
|
|
||||||
| for file in files: | ||||||
| destination_file = os.path.join(self.local_dir, file.removeprefix(base_dir)) | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The original code It's important to ensure that I'm marking this as critical because the bug causes all files to be saved in the root folder, which is a major issue.
Suggested change
|
||||||
| destination_file = os.path.join( | ||||||
| self.local_dir, file.removeprefix(f"{base_dir}/") | ||||||
| ) | ||||||
| local_dir = Path(destination_file).parent | ||||||
| os.makedirs(local_dir, exist_ok=True) | ||||||
| self.client.download_file(bucket_name, file, destination_file) | ||||||
|
|
||||||
Uh oh!
There was an error while loading. Please reload this page.
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.
Is there a way to avoid adding this to model config? @ganochenkodg
Edit: disregard this comment.
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.
@ganochenkodg, why would you need this
deviceconfig?Uh oh!
There was an error while loading. Please reload this page.
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.
@hnyls2002 In ModelConfig init function we run self._maybe_pull_model_tokenizer_from_remote() (line 116) that executes create_remote_connector, which requires 2 params - model_path and device (line 812). This device variable i can take in from_server_args method (line 240) and must store somewhere to pass in create_remote_connector.
I can remove storing device as a model parameter and pass it to pull_model_tokenizer function directly, like this:
- self.device = device
- self._maybe_pull_model_tokenizer_from_remote()
+ self._maybe_pull_model_tokenizer_from_remote(device)
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.
please do it, the device parameter should not be stored in model config.
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.
@hnyls2002 done, check it now please
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.
@ganochenkodg It still seems. tobe in
ModelConfig?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.
@b8zhong i left it in parameters, because i have no choice. we doesn't store store it in this.device now, only pass next. ModelConfig init function calls self._maybe_pull_model_tokenizer_from_remote (here) -> which calls client_remote_connector (here) whioch requires device as a parameter. so i added passing device parameter to init function in from_server_args (here), i can't find any other way to take "device" other than passing it here. without device create_remote_connector obviously crashes