From ee6c9d7b4763a1eead8190ccc2b570c315f799c0 Mon Sep 17 00:00:00 2001 From: marcsello Date: Wed, 28 Jul 2021 15:40:51 +0200 Subject: [PATCH] Moved frequently changed files to /dev/shm --- cnn_classification_service/cnn_classifier.py | 2 +- cnn_classification_service/magic_doer.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cnn_classification_service/cnn_classifier.py b/cnn_classification_service/cnn_classifier.py index 083ed02..35a3acd 100644 --- a/cnn_classification_service/cnn_classifier.py +++ b/cnn_classification_service/cnn_classifier.py @@ -38,7 +38,7 @@ class Classifier(object): spectogram = librosa.feature.melspectrogram(y=clip, sr=sample_rate) librosa.display.specshow(librosa.power_to_db(spectogram, ref=numpy.max)) - target_dir = tempfile.mkdtemp() + target_dir = tempfile.mkdtemp(dir="/dev/shm") wav_basename = os.path.basename(wav_filename) # Change extension to jpg... mert 110% biztos vagyok benne hogy a keras nem bírná beolvasni máshogy diff --git a/cnn_classification_service/magic_doer.py b/cnn_classification_service/magic_doer.py index 3dea995..c0e19b9 100644 --- a/cnn_classification_service/magic_doer.py +++ b/cnn_classification_service/magic_doer.py @@ -17,7 +17,7 @@ class MagicDoer: @classmethod def run_everything(cls, parameters: dict) -> dict: tag = parameters['tag'] - sample_file_handle, sample_file_path = tempfile.mkstemp(prefix=f"{tag}_", suffix=".wav") + sample_file_handle, sample_file_path = tempfile.mkstemp(prefix=f"{tag}_", suffix=".wav", dir="/dev/shm") response = None try: