SuveenE commited on
Commit
9e8f68e
·
1 Parent(s): a85ca4e
Files changed (1) hide show
  1. delete_episodes.py +9 -4
delete_episodes.py CHANGED
@@ -54,7 +54,7 @@ def download_dataset(
54
 
55
 
56
  def check_v2_format(dataset_path: str) -> bool:
57
- """Check if dataset is in v2.0 format"""
58
  info_path = os.path.join(dataset_path, "meta", "info.json")
59
 
60
  if not os.path.exists(info_path):
@@ -64,11 +64,16 @@ def check_v2_format(dataset_path: str) -> bool:
64
  try:
65
  info = json.load(f)
66
  if "codebase_version" not in info:
67
- raise ValueError(f"Error: {info_path} is not a valid v2.0 dataset")
68
- elif info["codebase_version"] != "v2.0":
 
 
 
69
  raise ValueError(
70
- f"Error: {info_path} is not a v2.0 dataset, found {info['codebase_version']}"
71
  )
 
 
72
  return True
73
  except json.JSONDecodeError:
74
  raise ValueError(f"Error: {info_path} is not a valid JSON file")
 
54
 
55
 
56
  def check_v2_format(dataset_path: str) -> bool:
57
+ """Check if dataset is in v2.x format"""
58
  info_path = os.path.join(dataset_path, "meta", "info.json")
59
 
60
  if not os.path.exists(info_path):
 
64
  try:
65
  info = json.load(f)
66
  if "codebase_version" not in info:
67
+ raise ValueError(f"Error: {info_path} is not a valid v2.x dataset")
68
+
69
+ version = info["codebase_version"]
70
+ # Accept any v2.x version (v2.0, v2.1, etc.)
71
+ if not version.startswith("v2."):
72
  raise ValueError(
73
+ f"Error: {info_path} is not a v2.x dataset, found {version}"
74
  )
75
+
76
+ logger.info(f"Dataset version: {version}")
77
  return True
78
  except json.JSONDecodeError:
79
  raise ValueError(f"Error: {info_path} is not a valid JSON file")