"...git@developer.sourcefind.cn:renzhc/diffusers_dcu.git" did not exist on "ada09bd3f0b38be6694f492c8ea463fd101f86cb"
Unverified Commit fe8a8fc0 authored by keli-wen's avatar keli-wen Committed by GitHub
Browse files

[Graphbolt] Modify `preprocess_ondisk_dataset` function. (#6017)

fix str
parent b26da252
...@@ -137,9 +137,9 @@ def preprocess_ondisk_dataset(input_config_path: str) -> str: ...@@ -137,9 +137,9 @@ def preprocess_ondisk_dataset(input_config_path: str) -> str:
): ):
# Always save the feature in numpy format. # Always save the feature in numpy format.
out_feature["format"] = "numpy" out_feature["format"] = "numpy"
out_feature["path"] = processed_dir_prefix / feature[ out_feature["path"] = str(
"path" processed_dir_prefix / feature["path"].replace("pt", "npy")
].replace("pt", "npy") )
if feature["format"] == "numpy": if feature["format"] == "numpy":
# If the original format is numpy, just copy the file. # If the original format is numpy, just copy the file.
...@@ -176,10 +176,9 @@ def preprocess_ondisk_dataset(input_config_path: str) -> str: ...@@ -176,10 +176,9 @@ def preprocess_ondisk_dataset(input_config_path: str) -> str:
): ):
# Always save the feature in numpy format. # Always save the feature in numpy format.
output_set_per_type["format"] = "numpy" output_set_per_type["format"] = "numpy"
output_set_per_type[ output_set_per_type["path"] = str(
"path" processed_dir_prefix
] = processed_dir_prefix / input_set_per_type["path"].replace( / input_set_per_type["path"].replace("pt", "npy")
"pt", "npy"
) )
if input_set_per_type["format"] == "numpy": if input_set_per_type["format"] == "numpy":
# If the original format is numpy, just copy the file. # If the original format is numpy, just copy the file.
...@@ -209,7 +208,7 @@ def preprocess_ondisk_dataset(input_config_path: str) -> str: ...@@ -209,7 +208,7 @@ def preprocess_ondisk_dataset(input_config_path: str) -> str:
with open(output_config_path, "w") as f: with open(output_config_path, "w") as f:
yaml.dump(output_config, f) yaml.dump(output_config, f)
print("Finish preprocessing the on-disk dataset.") print("Finish preprocessing the on-disk dataset.")
return output_config_path return str(output_config_path)
class OnDiskDataset(Dataset): class OnDiskDataset(Dataset):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment