tahirsher commited on
Commit
c3f9689
·
verified ·
1 Parent(s): 26ada0a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -16,7 +16,7 @@ from transformers import (
16
  # ================================
17
  # 1️⃣ Authenticate with Hugging Face Hub (Securely)
18
  # ================================
19
- HF_TOKEN = os.getenv("HF_TOKEN") # Ensure it's set in Hugging Face Spaces Secrets
20
 
21
  if HF_TOKEN is None:
22
  raise ValueError("❌ Hugging Face API token not found. Please set it in Secrets.")
@@ -90,7 +90,7 @@ def load_and_process_audio(audio_path):
90
  dataset = [{"input_features": load_and_process_audio(f), "labels": []} for f in audio_files[:100]]
91
 
92
  # Split dataset into train and eval
93
- train_size = int(0.9 * len(dataset))
94
  train_dataset = dataset[:train_size]
95
  eval_dataset = dataset[train_size:]
96
 
 
16
  # ================================
17
  # 1️⃣ Authenticate with Hugging Face Hub (Securely)
18
  # ================================
19
+ HF_TOKEN = os.getenv("hf_token") # Ensure it's set in Hugging Face Spaces Secrets
20
 
21
  if HF_TOKEN is None:
22
  raise ValueError("❌ Hugging Face API token not found. Please set it in Secrets.")
 
90
  dataset = [{"input_features": load_and_process_audio(f), "labels": []} for f in audio_files[:100]]
91
 
92
  # Split dataset into train and eval
93
+ train_size = int(0.8 * len(dataset))
94
  train_dataset = dataset[:train_size]
95
  eval_dataset = dataset[train_size:]
96