Skip to content

Commit 5370e0d

Browse files
felipemello1Felipe Mello
andauthored
[bug fix] remove config download when source is kaggle (#2144)
Co-authored-by: Felipe Mello <[email protected]>
1 parent d839f69 commit 5370e0d

File tree

2 files changed

+1
-8
lines changed

2 files changed

+1
-8
lines changed

torchtune/_cli/download.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -207,13 +207,6 @@ def _download_from_kaggle(self, args: argparse.Namespace) -> None:
207207
try:
208208
output_dir = model_download(model_handle)
209209

210-
# save the repo_id. This is necessary because the download step is a separate command
211-
# from the rest of the CLI. When saving a model adapter, we have to add the repo_id
212-
# to the adapter config.
213-
file_path = os.path.join(output_dir, REPO_ID_FNAME + ".json")
214-
with open(file_path, "w") as json_file:
215-
json.dump({"repo_id": args.repo_id}, json_file, indent=4)
216-
217210
print(
218211
"Successfully downloaded model repo and wrote to the following locations:",
219212
*list(Path(output_dir).iterdir()),

torchtune/training/checkpointing/_checkpointer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -827,7 +827,7 @@ def save_checkpoint(
827827
state_dict[
828828
training.ADAPTER_CONFIG
829829
] = convert_weights.tune_to_peft_adapter_config(
830-
state_dict[training.ADAPTER_CONFIG],
830+
adapter_config=state_dict[training.ADAPTER_CONFIG],
831831
base_model_name_or_path=self.repo_id,
832832
)
833833

0 commit comments

Comments
 (0)