Skip to content

Commit 2424080

Browse files
committed
fix
1 parent 19c5ce5 commit 2424080

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

mason.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -477,11 +477,11 @@ def make_internal_command(command: list[str], args: argparse.Namespace, whoami:
477477
try:
478478
model_arg_idx = filtered_command.index("--model_name_or_path")
479479
model_name_idx = model_arg_idx + 1
480-
model_name_or_path = filtered_command[model_name_idx]
480+
model_name_or_path = filtered_command[model_name_idx].rstrip("/")
481481

482482
if model_name_or_path.startswith("gs://"):
483483
model_name_hash = hashlib.md5(model_name_or_path.encode("utf-8")).hexdigest()[:8]
484-
local_cache_folder = f"{args.auto_output_dir_path}/{whoami}/tokenizer_{model_name_hash}"
484+
local_cache_folder = f"{args.auto_output_dir_path}/{whoami}/tokenizer_{model_name_hash}/"
485485

486486
if not os.path.exists(local_cache_folder):
487487
download_from_gs_bucket(f"{model_name_or_path}/tokenizer*", local_cache_folder)

open_instruct/utils.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1066,6 +1066,10 @@ def download_from_hf(model_name_or_path: str, revision: str) -> None:
10661066

10671067
def download_from_gs_bucket(src_path: str, dest_path: str) -> None:
10681068
cmd = [
1069+
"mkdir",
1070+
"-p",
1071+
dest_path,
1072+
"&&",
10691073
"gsutil",
10701074
"-o",
10711075
"GSUtil:parallel_thread_count=1",

0 commit comments

Comments
 (0)