From 0f6b41c61921e616a80e3b38cc28b1242fc53509 Mon Sep 17 00:00:00 2001 From: tro16 Date: Sat, 18 May 2024 13:41:49 +0200 Subject: [PATCH] testing --- .gitignore | 2 +- README.md | 2 +- amondin/__init__.py | 2 +- amondin/{transcription_tool.py => main.py} | 7 ++++--- setup.py | 4 ++-- 5 files changed, 9 insertions(+), 8 deletions(-) rename amondin/{transcription_tool.py => main.py} (87%) diff --git a/.gitignore b/.gitignore index 27ff63a..5a59cbc 100644 --- a/.gitignore +++ b/.gitignore @@ -126,5 +126,5 @@ dmypy.json data/ -secrets.yaml +*secrets.yaml *.csv \ No newline at end of file diff --git a/README.md b/README.md index ede9eea..52d51b6 100644 --- a/README.md +++ b/README.md @@ -1 +1 @@ -Simple Transcription tool using Huggigface models. +Simple Transcription tool using Huggingface models. diff --git a/amondin/__init__.py b/amondin/__init__.py index e13d7b7..9407430 100644 --- a/amondin/__init__.py +++ b/amondin/__init__.py @@ -4,4 +4,4 @@ from .diarize_speakers import diarize_speakers from .speech2text import speech2text from .tools import get_secret, convert_audio_to_wav -from .transcription_tool import transcribe +from .main import transcribe diff --git a/amondin/transcription_tool.py b/amondin/main.py similarity index 87% rename from amondin/transcription_tool.py rename to amondin/main.py index 4adb4fa..9889dfa 100644 --- a/amondin/transcription_tool.py +++ b/amondin/main.py @@ -9,12 +9,13 @@ def transcribe( - file_path: str, hf_token: str, language: str = "german", num_speakers: int = None, + input_file_path: str, output_file_path: str, hf_token: str, language: str = "german", num_speakers: int = None, s2t_model: str = "openai/whisper-tiny" ): """ Transcribe a give audio.wav file. - :param file_path: + :param output_file_path: + :param input_file_path: :param hf_token: :param language: Set the language for improved performance. None results in language detection. :param num_speakers: Set the number of speakers for improved performance. None results in @@ -24,7 +25,7 @@ def transcribe( """ print("Diarizing speakers...") diarized_speakers = diarize_speakers( - file_path, + input_file_path, hf_token=hf_token, num_speakers=num_speakers, ) diff --git a/setup.py b/setup.py index 018a8c9..dd8cee7 100644 --- a/setup.py +++ b/setup.py @@ -13,10 +13,10 @@ "pyannote.core==5.0.0", "pyyaml==6.0.1", "ffmpeg-python==0.2.0", - "pandas==2.2.2", + "pandas==2.2.1", "librosa==0.10.1", "soundfile==0.12.1", "numpy==1.26.4", - "torch==2.2.2", + "torch==2.2.1", ] ) \ No newline at end of file