File size: 645 Bytes
f64f353
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import json

SRC_JSON = "videos.json"          # 기존 파일 경로
DST_JSON = "videos_updated.json"  # 새로 저장할 파일 경로
NEW_DATASET = "dghadiya/video_eval_examples"  # public dataset 이름

with open(SRC_JSON, "r") as f:
    data = json.load(f)

for item in data:
    # item["id"] 예: "Wan2.2/Wan2.2_BodyWeightSquats_03_g09_c02.mp4"
    path_in_repo = item["id"]

    # 새 URL로 교체
    item["url"] = (
        f"https://huggingface.co/datasets/{NEW_DATASET}/resolve/main/{path_in_repo}"
    )

# 저장
with open(DST_JSON, "w") as f:
    json.dump(data, f, indent=2)

print(f"updated {len(data)} entries -> {DST_JSON}")