Marcos12886 commited on
Commit
c018c8e
1 Parent(s): 4f265c1

app: usar load_dataset

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -3,10 +3,12 @@ import torch
3
  import gradio as gr
4
  from huggingface_hub import InferenceClient
5
  from model import model_params, AudioDataset
 
6
 
 
 
7
  token = os.getenv("HF_TOKEN")
8
- dataset_path = f"A-POR-LOS-8000/baby_cry_detection" # PARA MONITOR
9
- # dataset_path = f"data/mixed_data_nuevo" # PARA CLASIFICADOR
10
  model, _, _, id2label = model_params(dataset_path)
11
  device = torch.device("cuda" if torch.cuda.is_available() else "cpu")# Usar a GPU o CPU
12
  model.to(device)# Usar a GPU o CPU
 
3
  import gradio as gr
4
  from huggingface_hub import InferenceClient
5
  from model import model_params, AudioDataset
6
+ from datasets import load_dataset
7
 
8
+ # dataset_path = "data/baby_cry_detection" # PARA MONITOR
9
+ # dataset_path = "data/mixed_data_nuevo" # PARA CLASIFICADOR
10
  token = os.getenv("HF_TOKEN")
11
+ dataset_path = load_dataset("A-POR-LOS-8000/baby_cry_detection") # PARA MONITOR
 
12
  model, _, _, id2label = model_params(dataset_path)
13
  device = torch.device("cuda" if torch.cuda.is_available() else "cpu")# Usar a GPU o CPU
14
  model.to(device)# Usar a GPU o CPU