code-HFD / tests /test_hfd_storage_paths.py
Tinghong-Ye22's picture
Add files using upload-large-folder tool
aa02c28 verified
Raw History Blame Contribute Delete
1.84 kB
from pathlib import Path
from psi.data.seed.storage_paths import relocate_hfd_storage_path
def test_relocates_legacy_hfd_storage_prefixes() -> None:
root = (
"/cpfs01/thscc/sharestorage/AIGC-06-01/Hithink_VideoGen_Group/"
"user_workspace"
)
assert relocate_hfd_storage_path(
"/cpfs01/videogen/yetinghong/datasets/hfd_control_commands_v1/"
"manifest.jsonl"
) == Path(
f"{root}/yetinghong/videogen/hfd_control_commands_v1/manifest.jsonl"
)
assert relocate_hfd_storage_path(
"/cpfs01/users/buwendong/code/qwen3-tts/metadata.jsonl"
) == Path(f"{root}/buwendong/user/code/qwen3-tts/metadata.jsonl")
assert relocate_hfd_storage_path(
"/cpfs01/users/yetinghong/code/HFD/run_config.json"
) == Path(f"{root}/yetinghong/code/HFD/run_config.json")
def test_relocates_embedded_legacy_tts_waveform_path() -> None:
assert relocate_hfd_storage_path(
"/cpfs01/users/buwendong/code/qwen3-tts/seed_audio/"
"003782/female_02_en.wav"
) == Path(
"/cpfs01/thscc/sharestorage/AIGC-06-01/Hithink_VideoGen_Group/"
"user_workspace/buwendong/user/code/qwen3-tts/seed_audio/"
"003782/female_02_en.wav"
)
def test_keeps_qwen_and_relative_paths_unchanged() -> None:
qwen = Path(
"/cpfs01/thscc/sharestorage/AIGC-06-01/Hithink_VideoGen_Group/"
"team_workspace/public_ckpt/Qwen/Qwen2.5-Omni-3B"
)
relative = Path("manifests/background_sessions.jsonl")
migrated = Path(
"/cpfs01/thscc/sharestorage/AIGC-06-01/Hithink_VideoGen_Group/"
"user_workspace/buwendong/user/code/qwen3-tts/metadata.jsonl"
)
assert relocate_hfd_storage_path(qwen) == qwen
assert relocate_hfd_storage_path(relative) == relative
assert relocate_hfd_storage_path(migrated) == migrated