LAURENT Valentin commited on
Commit
370db2b
·
1 Parent(s): fb5b7f7
Files changed (1) hide show
  1. tasks/audio.py +3 -4
tasks/audio.py CHANGED
@@ -21,7 +21,7 @@ ROUTE = "/audio"
21
  def create_spec(dataset):
22
  spectograms = []
23
 
24
- for d in enumerate(dataset):
25
  audio_sample = d["audio"]["array"] if d["audio"]["sampling_rate"] == 12000 else librosa.resample(
26
  d["audio"]["array"],
27
  orig_sr= d["audio"]["sampling_rate"],
@@ -85,10 +85,9 @@ async def evaluate_audio(request: AudioEvaluationRequest):
85
  tracker.start_task("inference")
86
 
87
  test_spec = create_spec(test_dataset)
88
- H = np.load("array_file.npy")
89
  W_test = np.dot(test_spec, H)
90
- model_filename = 'model.joblib'
91
- model = joblib.load(model_filename)
92
  #--------------------------------------------------------------------------------------------
93
  # YOUR MODEL INFERENCE CODE HERE
94
  # Update the code below to replace the random baseline by your model inference within the inference pass where the energy consumption and emissions are tracked.
 
21
  def create_spec(dataset):
22
  spectograms = []
23
 
24
+ for d in dataset:
25
  audio_sample = d["audio"]["array"] if d["audio"]["sampling_rate"] == 12000 else librosa.resample(
26
  d["audio"]["array"],
27
  orig_sr= d["audio"]["sampling_rate"],
 
85
  tracker.start_task("inference")
86
 
87
  test_spec = create_spec(test_dataset)
88
+ H = np.load("H.npy")
89
  W_test = np.dot(test_spec, H)
90
+ model = joblib.load('model.joblib')
 
91
  #--------------------------------------------------------------------------------------------
92
  # YOUR MODEL INFERENCE CODE HERE
93
  # Update the code below to replace the random baseline by your model inference within the inference pass where the energy consumption and emissions are tracked.