sp03 commited on
Commit
f7ce26b
·
verified ·
1 Parent(s): 3ca4483

Update dataset.py

Browse files
Files changed (1) hide show
  1. dataset.py +2 -2
dataset.py CHANGED
@@ -4,11 +4,11 @@ from datasets import DatasetDict, Dataset, Audio
4
  from sklearn.model_selection import train_test_split
5
 
6
  def load_data(data_dir, test_size=0.2, seed=42):
7
- # Load metadata
8
  metadata = pd.read_csv(os.path.join(data_dir, "metadata.csv"))
9
 
10
  # Split the data into train and test subsets
11
- train_data, test_data = train_test_split(metadata, test_size=test_size, random_state=seed)
12
 
13
  # Convert to Hugging Face datasets
14
  train_dataset = Dataset.from_pandas(train_data)
 
4
  from sklearn.model_selection import train_test_split
5
 
6
  def load_data(data_dir, test_size=0.2, seed=42):
7
+
8
  metadata = pd.read_csv(os.path.join(data_dir, "metadata.csv"))
9
 
10
  # Split the data into train and test subsets
11
+ train_data, test_data = train_test_split(metadata, test_size=0.2, random_state=seed)
12
 
13
  # Convert to Hugging Face datasets
14
  train_dataset = Dataset.from_pandas(train_data)