#!/usr/bin/env python3 import os from pathlib import Path import huggingface_hub from datasets import Audio, Dataset import pandas as pd repo_root = Path(__file__).resolve().parent.parent metadata = os.path.join(repo_root, 'data', 'kendex', 'metadata.csv') wavs = os.path.join(repo_root, 'data', 'kendex', 'wavs') df = pd.read_csv(metadata, delimiter='|', header=None) dataset = Dataset.from_pandas(pd.DataFrame({ 'audio': pd.Series([ os.path.join(wavs, f"{f}.wav") for f in df[0] ]), 'text': df[1], })) dataset = dataset.cast_column("audio", Audio(sampling_rate=16_000)) huggingface_hub.login() dataset.push_to_hub("michaelnetbiz/kendex")