diff --git a/myproject/myapp/views.py b/myproject/myapp/views.py index f4b3cd10c0849f4b727bc9bf7fa626a257d8922e..e5d4d15683ed07534f20a3ea1882ee39a5ad3050 100644 --- a/myproject/myapp/views.py +++ b/myproject/myapp/views.py @@ -230,11 +230,11 @@ class InstrumentDetectionView(APIView): audio_file = serializer.validated_data['audio_file'] # Save the uploaded file temporarily - with open('temp_audio.wav', 'wb') as f: - f.write(audio_file.read()) + # with open('temp_audio.wav', 'wb') as f: + # f.write(audio_file.read()) # Preprocess the audio file - preprocessed_data = preprocess_audio_for_inference('temp_audio.wav') + preprocessed_data = preprocess_audio_for_inference(audio_file) # Prepare data for TensorFlow Serving data = json.dumps({"signature_name": "serving_default", "instances": [window.tolist() for window in preprocessed_data]}) diff --git a/myproject/temp_audio.wav b/myproject/temp_audio.wav deleted file mode 100644 index b47a440af0d73187525a2566509da3183762a8e5..0000000000000000000000000000000000000000 Binary files a/myproject/temp_audio.wav and /dev/null differ