File size: 1,837 Bytes
aa02c28 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 | 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
|