[Benchmark] Benchmark Running Samples for Qwen3 Omni and Dataset Preparation (#212)
Signed-off-by: tzhouam <tzhouam@connect.ust.hk> Signed-off-by: Zhou Taichang <tzhouam@connect.ust.hk>
This commit is contained in:
1 parent
c4cd502d82
commit
1f4e1badc6
10 files changed
+899
No files matched your search
@@ -0,0 +1,82 @@
|
||||
# Benchmark Dataset Preparation Guide
|
||||
|
||||
This guide describes how to download and prepare the SeedTTS test dataset for benchmarking Qwen-Omni models.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
- Python 3.8+
|
||||
- `gdown` for downloading from Google Drive
|
||||
- Access to the benchmark scripts
|
||||
|
||||
## Steps
|
||||
|
||||
### 1. Navigate to the Dataset Directory
|
||||
|
||||
```bash
|
||||
cd benchmarks/build_dataset
|
||||
```
|
||||
|
||||
### 2. Install Dependencies
|
||||
|
||||
```bash
|
||||
pip install gdown
|
||||
```
|
||||
|
||||
### 3. Download the SeedTTS Test Dataset
|
||||
|
||||
Download the dataset from Google Drive:
|
||||
|
||||
```bash
|
||||
gdown --id 1GlSjVfSHkW3-leKKBlfrjuuTGqQ_xaLP
|
||||
```
|
||||
|
||||
### 4. Extract the Dataset
|
||||
|
||||
```bash
|
||||
tar -xf seedtts_testset.tar
|
||||
```
|
||||
|
||||
### 5. Prepare the Metadata File
|
||||
|
||||
Copy the English metadata file to the working directory:
|
||||
|
||||
```bash
|
||||
cp seedtts_testset/en/meta.lst meta.lst
|
||||
```
|
||||
|
||||
### 6. Extract Prompts
|
||||
|
||||
Extract the first N prompts from the metadata file:
|
||||
|
||||
```bash
|
||||
# Extract top 100 prompts (adjust -n for different amounts)
|
||||
python extract_tts_prompts.py -i meta.lst -o top100.txt -n 100
|
||||
```
|
||||
|
||||
**Options:**
|
||||
- `-i, --input`: Input metadata file (default: `meta.lst`)
|
||||
- `-o, --output`: Output prompts file (default: `prompts.txt`)
|
||||
- `-n, --num_lines`: Number of prompts to extract (required)
|
||||
|
||||
### 7. Clean Up (Optional)
|
||||
|
||||
Remove temporary files to save disk space:
|
||||
|
||||
```bash
|
||||
rm -rf seedtts_testset
|
||||
rm seedtts_testset.tar
|
||||
rm meta.lst
|
||||
```
|
||||
|
||||
## Quick Start (All-in-One)
|
||||
|
||||
```bash
|
||||
# Full setup and benchmark
|
||||
cd benchmarks/build_dataset
|
||||
pip install gdown
|
||||
gdown --id 1GlSjVfSHkW3-leKKBlfrjuuTGqQ_xaLP
|
||||
tar -xf seedtts_testset.tar
|
||||
cp seedtts_testset/en/meta.lst meta.lst
|
||||
python extract_tts_prompts.py -i meta.lst -o top100.txt -n 100
|
||||
rm -rf seedtts_testset seedtts_testset.tar meta.lst
|
||||
```
|
||||
@@ -0,0 +1,73 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
Extract prompts from meta.lst and save them to a txt file.
|
||||
|
||||
Each line in meta.lst has the format:
|
||||
ID|prompt_text|audio_path|target_text
|
||||
|
||||
This script extracts the prompt_text (second field) from the first N lines.
|
||||
"""
|
||||
|
||||
import argparse
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
def extract_prompts(input_file: str, output_file: str, num_lines: int) -> None:
|
||||
"""
|
||||
Extract prompts from meta.lst and save to output file.
|
||||
|
||||
Args:
|
||||
input_file: Path to the meta.lst file
|
||||
output_file: Path to the output txt file
|
||||
num_lines: Number of lines to process
|
||||
"""
|
||||
prompts = []
|
||||
|
||||
with open(input_file, encoding="utf-8") as f:
|
||||
for i, line in enumerate(f):
|
||||
if i >= num_lines:
|
||||
break
|
||||
|
||||
line = line.strip()
|
||||
if not line: # Skip empty lines
|
||||
continue
|
||||
|
||||
parts = line.split("|")
|
||||
if len(parts) >= 2:
|
||||
prompt = parts[1] # The prompt is the second field
|
||||
prompts.append(prompt)
|
||||
|
||||
# Write prompts to output file
|
||||
with open(output_file, "w", encoding="utf-8") as f:
|
||||
for prompt in prompts:
|
||||
f.write(prompt + "\n")
|
||||
|
||||
# Print result stats
|
||||
print(f"Extracted {len(prompts)} prompts from first {num_lines} lines")
|
||||
print(f"Saved to: {output_file}")
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser(description="Extract prompts from meta.lst file")
|
||||
parser.add_argument(
|
||||
"-i", "--input", type=str, default="meta.lst", help="Input meta.lst file path (default: meta.lst)"
|
||||
)
|
||||
parser.add_argument(
|
||||
"-o", "--output", type=str, default="prompts.txt", help="Output txt file path (default: prompts.txt)"
|
||||
)
|
||||
parser.add_argument(
|
||||
"-n", "--num_lines", type=int, required=True, help="Number of lines to extract from the beginning"
|
||||
)
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
# Check if input file exists
|
||||
if not Path(args.input).exists():
|
||||
print(f"Error: Input file '{args.input}' not found")
|
||||
return
|
||||
|
||||
extract_prompts(args.input, args.output, args.num_lines)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Reference in new issue
Block a user