Spaces:
Running
Running
deveix
commited on
Commit
·
9dae67d
1
Parent(s):
cb0323f
fix print
Browse files- app/main.py +4 -4
app/main.py
CHANGED
@@ -330,7 +330,7 @@ async def handle_audio(file: UploadFile = File(...)):
|
|
330 |
# repair_mp3_with_ffmpeg_python(temp_filename, temp_filename)
|
331 |
# # Here you would add the feature extraction logic
|
332 |
# features = extract_features(temp_filename)
|
333 |
-
print("Extracted Features:", features)
|
334 |
# features = pca.transform(features)
|
335 |
# features = np.array(features).reshape(1, -1)
|
336 |
features = features.reshape(1, -1)
|
@@ -343,13 +343,13 @@ async def handle_audio(file: UploadFile = File(...)):
|
|
343 |
|
344 |
# # Decode the predictions using the label encoder
|
345 |
decoded_predictions = label_encoder.inverse_transform(results)
|
346 |
-
print(decoded_predictions)
|
347 |
# .tolist()
|
348 |
# Clean up the temporary file
|
349 |
os.remove(temp_filename)
|
350 |
-
|
351 |
# Return a successful response with decoded predictions
|
352 |
-
return {"message": "File processed successfully", "
|
353 |
except Exception as e:
|
354 |
print(e)
|
355 |
# Handle possible exceptions
|
|
|
330 |
# repair_mp3_with_ffmpeg_python(temp_filename, temp_filename)
|
331 |
# # Here you would add the feature extraction logic
|
332 |
# features = extract_features(temp_filename)
|
333 |
+
# print("Extracted Features:", features)
|
334 |
# features = pca.transform(features)
|
335 |
# features = np.array(features).reshape(1, -1)
|
336 |
features = features.reshape(1, -1)
|
|
|
343 |
|
344 |
# # Decode the predictions using the label encoder
|
345 |
decoded_predictions = label_encoder.inverse_transform(results)
|
346 |
+
print('decoded', decoded_predictions[0])
|
347 |
# .tolist()
|
348 |
# Clean up the temporary file
|
349 |
os.remove(temp_filename)
|
350 |
+
print({"message": "File processed successfully", "sheikh": decoded_predictions[0]})
|
351 |
# Return a successful response with decoded predictions
|
352 |
+
return {"message": "File processed successfully", "sheikh": decoded_predictions[0]}
|
353 |
except Exception as e:
|
354 |
print(e)
|
355 |
# Handle possible exceptions
|