Skip to content

Commit

Permalink
Remove : from the generated filenames (NVIDIA#373)
Browse files Browse the repository at this point in the history
Windows does not allow to have : (and few other characters) in the
filenames. This is particularly enforced in HuggingFace API (in
datasets.BuilderConfig class).

Use underscore instead of : in the filenames.

Signed-off-by: Alexander Bokovoy <[email protected]>
  • Loading branch information
abbra authored Mar 7, 2024
1 parent 06f6d0f commit 3329b4b
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions cli/generator/generate_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,15 +221,10 @@ def generate_data(
)

name = Path(model_name).stem # Just in case it is a file path
output_file = (
f"generated_{name}_{datetime.now().replace(microsecond=0).isoformat()}.json"
)
output_file_train = (
f"train_{name}_{datetime.now().replace(microsecond=0).isoformat()}.jsonl"
)
output_file_test = (
f"test_{name}_{datetime.now().replace(microsecond=0).isoformat()}.jsonl"
)
date_suffix = datetime.now().replace(microsecond=0).isoformat().replace(":", "_")
output_file = f"generated_{name}_{date_suffix}.json"
output_file_train = f"train_{name}_{date_suffix}.jsonl"
output_file_test = f"test_{name}_{date_suffix}.jsonl"
logger.debug(f"Generating to: {os.path.join(output_dir, output_file)}")

request_idx = 0
Expand Down

0 comments on commit 3329b4b

Please sign in to comment.