intersteller2887 commited on
Commit
d3bc3b0
·
verified ·
1 Parent(s): c660ebe

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -9
app.py CHANGED
@@ -8,17 +8,18 @@ from huggingface_hub import HfApi
8
 
9
  dataset = load_dataset("intersteller2887/Turing-test-dataset", split="train")
10
 
11
- print(dataset[0]) # 查看第一条数据结构
12
- print(type(dataset[0]['audio'])) # audio字段的类型
13
- print(dataset[0]['audio']) # audio字段的具体值
14
-
15
- all_data_audio_paths = [
16
- item['audio']['path'] for item in dataset
17
- if item['audio']['path'].endswith(".wav") and "/data/" in item['audio']['path'].replace("\\", "/")
18
  ]
19
 
20
- for p in all_data_audio_paths:
21
- print(p)
 
 
 
 
22
 
23
  sample1_audio_path = next((p for p in all_data_audio_paths if p.endswith("sample1.wav")), None)
24
 
 
8
 
9
  dataset = load_dataset("intersteller2887/Turing-test-dataset", split="train")
10
 
11
+ all_audio_paths = [
12
+ item["audio"]["path"]
13
+ for item in dataset
14
+ if item["audio"] and "path" in item["audio"]
 
 
 
15
  ]
16
 
17
+ print("Found audio files:")
18
+ for path in all_audio_paths[:5]:
19
+ print(path)
20
+
21
+ valid_audio_paths = [path for path in all_audio_paths if os.path.exists(path)]
22
+ print(f"Total valid audio files: {len(valid_audio_paths)}")
23
 
24
  sample1_audio_path = next((p for p in all_data_audio_paths if p.endswith("sample1.wav")), None)
25