From df1a3c075b91f0c7f0d775540fd792a3983b6ccb Mon Sep 17 00:00:00 2001 From: Orihara Izaya Date: Mon, 9 Oct 2023 18:13:32 +0200 Subject: [PATCH] Test: ran the code and checked for ffmpeg functionality --- README.md | 8 +++++++- data/results/Here_results_are_saved.txt | 0 src/main.py => main.py | 0 requirements.txt | 2 ++ src/transcriber.py | 6 ++---- 5 files changed, 11 insertions(+), 5 deletions(-) create mode 100644 data/results/Here_results_are_saved.txt rename src/main.py => main.py (100%) diff --git a/README.md b/README.md index 38ef6fb..7f5e920 100644 --- a/README.md +++ b/README.md @@ -12,11 +12,17 @@ Before running this script, make sure to install the necessary python packages u pip install -r requirements.txt ``` +If your system does not have ffmpeg installed you can install it via: + +```bash +sudo apt install ffmpeg +``` + ## Running the script To generate transcripts create a new job with your specifications (see jobs section below).
-If you need to download the transcriber model (not saved in `data/models` yet) set your huggingface token: +If you need to download the transcriber model set your huggingface token: On Linux/Mac: diff --git a/data/results/Here_results_are_saved.txt b/data/results/Here_results_are_saved.txt new file mode 100644 index 0000000..e69de29 diff --git a/src/main.py b/main.py similarity index 100% rename from src/main.py rename to main.py diff --git a/requirements.txt b/requirements.txt index 8ed7f28..9ec58e7 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,7 @@ youtube-dl pytube pydub +ffmpeg-python +ffprobe torch git+https://github.com/m-bain/whisperx.git \ No newline at end of file diff --git a/src/transcriber.py b/src/transcriber.py index 476ac4f..4842b7a 100644 --- a/src/transcriber.py +++ b/src/transcriber.py @@ -102,14 +102,12 @@ class Transcriber: logger.exception("Failed to save transcript: %s", e) raise - def _clear_memory(self): + @staticmethod + def _clear_memory(): """ Clear GPU memory. """ try: - del self.transcription_model - del self.alignment_model - del self.metadata gc.collect() torch.cuda.empty_cache() except Exception as e: