audio-scribe 0.1.2__py3-none-any.whl → 0.1.4__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- audio_scribe/__init__.py +2 -2
- audio_scribe/auth.py +4 -1
- audio_scribe/config.py +3 -1
- audio_scribe/models.py +54 -36
- audio_scribe/transcriber.py +17 -13
- audio_scribe/utils.py +13 -11
- audio_scribe-0.1.4.dist-info/LICENSE +201 -0
- {audio_scribe-0.1.2.dist-info → audio_scribe-0.1.4.dist-info}/METADATA +34 -11
- audio_scribe-0.1.4.dist-info/RECORD +12 -0
- audio_scribe-0.1.2.dist-info/RECORD +0 -11
- {audio_scribe-0.1.2.dist-info → audio_scribe-0.1.4.dist-info}/WHEEL +0 -0
- {audio_scribe-0.1.2.dist-info → audio_scribe-0.1.4.dist-info}/entry_points.txt +0 -0
- {audio_scribe-0.1.2.dist-info → audio_scribe-0.1.4.dist-info}/top_level.txt +0 -0
audio_scribe/__init__.py
CHANGED
@@ -11,7 +11,7 @@ from .config import TranscriptionConfig
|
|
11
11
|
from .auth import TokenManager
|
12
12
|
from .utils import DependencyManager, complete_path
|
13
13
|
|
14
|
-
__version__ = "0.1.
|
14
|
+
__version__ = "0.1.4"
|
15
15
|
|
16
16
|
__all__ = [
|
17
17
|
"main",
|
@@ -21,4 +21,4 @@ __all__ = [
|
|
21
21
|
"TokenManager",
|
22
22
|
"DependencyManager",
|
23
23
|
"complete_path",
|
24
|
-
]
|
24
|
+
]
|
audio_scribe/auth.py
CHANGED
@@ -12,8 +12,10 @@ from cryptography.hazmat.primitives.kdf.pbkdf2 import PBKDF2HMAC
|
|
12
12
|
|
13
13
|
logger = logging.getLogger(__name__)
|
14
14
|
|
15
|
+
|
15
16
|
class TokenManager:
|
16
17
|
"""Handles secure storage and retrieval of the Hugging Face authentication token."""
|
18
|
+
|
17
19
|
def __init__(self):
|
18
20
|
# Store config in ~/.pyannote/config.json
|
19
21
|
self.config_dir = Path.home() / ".pyannote"
|
@@ -94,6 +96,7 @@ class TokenManager:
|
|
94
96
|
logger.error(f"Failed to delete token: {e}")
|
95
97
|
return False
|
96
98
|
|
99
|
+
|
97
100
|
def get_token(token_manager: TokenManager) -> Optional[str]:
|
98
101
|
"""Get authentication token from storage or user input."""
|
99
102
|
stored_token = token_manager.retrieve_token()
|
@@ -116,4 +119,4 @@ def get_token(token_manager: TokenManager) -> Optional[str]:
|
|
116
119
|
print("Token saved successfully.")
|
117
120
|
else:
|
118
121
|
print("Failed to save token. It will be used for this session only.")
|
119
|
-
return token if token else None
|
122
|
+
return token if token else None
|
audio_scribe/config.py
CHANGED
@@ -5,9 +5,11 @@ from pathlib import Path
|
|
5
5
|
from typing import Optional
|
6
6
|
import torch
|
7
7
|
|
8
|
+
|
8
9
|
@dataclass
|
9
10
|
class TranscriptionConfig:
|
10
11
|
"""Configuration settings for the transcription pipeline."""
|
12
|
+
|
11
13
|
output_directory: Path
|
12
14
|
whisper_model: str = "base.en"
|
13
15
|
diarization_model: str = "pyannote/speaker-diarization-3.1"
|
@@ -21,4 +23,4 @@ class TranscriptionConfig:
|
|
21
23
|
self.temp_directory = self.temp_directory or (self.output_directory / "temp")
|
22
24
|
# Ensure directories exist
|
23
25
|
self.temp_directory.mkdir(parents=True, exist_ok=True)
|
24
|
-
self.output_directory.mkdir(parents=True, exist_ok=True)
|
26
|
+
self.output_directory.mkdir(parents=True, exist_ok=True)
|
audio_scribe/models.py
CHANGED
@@ -2,14 +2,14 @@
|
|
2
2
|
|
3
3
|
import wave
|
4
4
|
import torch
|
5
|
-
import
|
5
|
+
from typing import Optional, Any, cast
|
6
|
+
import whisper # type: ignore
|
6
7
|
import logging
|
7
8
|
import warnings
|
8
9
|
import threading
|
9
10
|
from datetime import datetime
|
10
11
|
from pathlib import Path
|
11
|
-
from
|
12
|
-
from pyannote.audio import Pipeline
|
12
|
+
from pyannote.audio import Pipeline # type: ignore
|
13
13
|
|
14
14
|
from .config import TranscriptionConfig
|
15
15
|
from .auth import TokenManager
|
@@ -17,9 +17,10 @@ from .auth import TokenManager
|
|
17
17
|
logger = logging.getLogger(__name__)
|
18
18
|
|
19
19
|
try:
|
20
|
-
from alive_progress import alive_bar
|
20
|
+
from alive_progress import alive_bar # type: ignore
|
21
21
|
import psutil
|
22
|
-
import GPUtil
|
22
|
+
import GPUtil # type: ignore
|
23
|
+
|
23
24
|
HAVE_PROGRESS_SUPPORT = True
|
24
25
|
except ImportError:
|
25
26
|
HAVE_PROGRESS_SUPPORT = False
|
@@ -27,7 +28,7 @@ except ImportError:
|
|
27
28
|
|
28
29
|
class AudioProcessor:
|
29
30
|
"""Handles audio file processing and segmentation."""
|
30
|
-
|
31
|
+
|
31
32
|
def __init__(self, config: TranscriptionConfig):
|
32
33
|
self.config = config
|
33
34
|
|
@@ -60,13 +61,15 @@ class AudioProcessor:
|
|
60
61
|
|
61
62
|
class TranscriptionPipeline:
|
62
63
|
"""Main pipeline for audio transcription and speaker diarization."""
|
63
|
-
|
64
|
+
|
64
65
|
def __init__(self, config: TranscriptionConfig):
|
65
66
|
self.config = config
|
66
|
-
self.diarization_pipeline = None
|
67
|
-
self.whisper_model = None
|
67
|
+
self.diarization_pipeline: Optional[Pipeline] = None
|
68
|
+
self.whisper_model: Optional[Any] = None
|
68
69
|
self.token_manager = TokenManager()
|
69
|
-
self._running = False
|
70
|
+
self._running = False
|
71
|
+
assert config.temp_directory is not None
|
72
|
+
self.temp_directory: Path = config.temp_directory
|
70
73
|
|
71
74
|
def initialize_models(self, auth_token: str) -> bool:
|
72
75
|
"""Initialize the Pyannote diarization pipeline and Whisper model."""
|
@@ -80,13 +83,17 @@ class TranscriptionPipeline:
|
|
80
83
|
|
81
84
|
# Load Pyannote diarization pipeline
|
82
85
|
self.diarization_pipeline = Pipeline.from_pretrained(
|
83
|
-
self.config.diarization_model,
|
84
|
-
use_auth_token=auth_token
|
86
|
+
self.config.diarization_model, use_auth_token=auth_token
|
85
87
|
)
|
86
|
-
|
88
|
+
|
89
|
+
if self.diarization_pipeline is not None:
|
90
|
+
device = torch.device(cast(str, self.config.device))
|
91
|
+
self.diarization_pipeline.to(device)
|
87
92
|
|
88
93
|
if self.config.device == "cpu":
|
89
|
-
warnings.warn(
|
94
|
+
warnings.warn(
|
95
|
+
"Running on CPU. GPU is recommended for better performance."
|
96
|
+
)
|
90
97
|
|
91
98
|
return True
|
92
99
|
except Exception as e:
|
@@ -96,15 +103,20 @@ class TranscriptionPipeline:
|
|
96
103
|
logger.error(" 2. https://huggingface.co/pyannote/speaker-diarization-3.1")
|
97
104
|
return False
|
98
105
|
|
99
|
-
def _update_resources(self, bar):
|
106
|
+
def _update_resources(self, bar: Any) -> None:
|
100
107
|
"""Update progress bar with resource usage information."""
|
101
108
|
while self._running:
|
102
109
|
try:
|
103
110
|
import time
|
111
|
+
|
104
112
|
time.sleep(0.5)
|
105
113
|
|
106
|
-
cpu_usage =
|
107
|
-
|
114
|
+
cpu_usage = (
|
115
|
+
psutil.cpu_percent(interval=None) if HAVE_PROGRESS_SUPPORT else 0
|
116
|
+
)
|
117
|
+
memory_usage = (
|
118
|
+
psutil.virtual_memory().percent if HAVE_PROGRESS_SUPPORT else 0
|
119
|
+
)
|
108
120
|
|
109
121
|
if HAVE_PROGRESS_SUPPORT and GPUtil.getGPUs():
|
110
122
|
gpus = GPUtil.getGPUs()
|
@@ -122,6 +134,10 @@ class TranscriptionPipeline:
|
|
122
134
|
def process_file(self, audio_path: Path) -> bool:
|
123
135
|
"""Diarize, segment, and transcribe using Whisper + Pyannote with progress feedback."""
|
124
136
|
try:
|
137
|
+
if self.diarization_pipeline is None or self.whisper_model is None:
|
138
|
+
logger.error("Pipeline not initialized. Call initialize_models first.")
|
139
|
+
return False
|
140
|
+
|
125
141
|
logger.info("Starting audio processing...")
|
126
142
|
diarization = self.diarization_pipeline(str(audio_path))
|
127
143
|
segments = list(diarization.itertracks(yield_label=True))
|
@@ -132,16 +148,19 @@ class TranscriptionPipeline:
|
|
132
148
|
audio_processor = AudioProcessor(self.config)
|
133
149
|
|
134
150
|
if not HAVE_PROGRESS_SUPPORT:
|
135
|
-
#
|
136
|
-
logger.info("Processing audio without progress bar (missing optional packages).")
|
151
|
+
# Process without progress bar
|
137
152
|
with output_file.open("w", encoding="utf-8") as f:
|
138
153
|
for turn, _, speaker in segments:
|
139
154
|
segment_path = (
|
140
|
-
self.
|
155
|
+
self.temp_directory
|
141
156
|
/ f"segment_{speaker}_{turn.start:.2f}_{turn.end:.2f}.wav"
|
142
157
|
)
|
143
|
-
if audio_processor.load_audio_segment(
|
144
|
-
|
158
|
+
if audio_processor.load_audio_segment(
|
159
|
+
audio_path, turn.start, turn.end, segment_path
|
160
|
+
):
|
161
|
+
transcription = self.whisper_model.transcribe(
|
162
|
+
str(segment_path)
|
163
|
+
)["text"]
|
145
164
|
segment_path.unlink(missing_ok=True)
|
146
165
|
|
147
166
|
line = f"[{turn.start:.2f}s - {turn.end:.2f}s] Speaker {speaker}: {transcription.strip()}\n"
|
@@ -149,11 +168,7 @@ class TranscriptionPipeline:
|
|
149
168
|
logger.info(line.strip())
|
150
169
|
return True
|
151
170
|
else:
|
152
|
-
# Use
|
153
|
-
from alive_progress import alive_bar
|
154
|
-
import threading
|
155
|
-
|
156
|
-
self._running = True
|
171
|
+
# Use progress bar
|
157
172
|
with output_file.open("w", encoding="utf-8") as f, alive_bar(
|
158
173
|
total_segments,
|
159
174
|
title="Transcribing Audio",
|
@@ -163,28 +178,31 @@ class TranscriptionPipeline:
|
|
163
178
|
elapsed=True,
|
164
179
|
monitor=True,
|
165
180
|
) as bar:
|
166
|
-
|
167
|
-
|
168
|
-
|
181
|
+
self._running = True
|
182
|
+
resource_thread = threading.Thread(
|
183
|
+
target=self._update_resources, args=(bar,)
|
184
|
+
)
|
169
185
|
resource_thread.start()
|
170
186
|
|
171
187
|
for turn, _, speaker in segments:
|
172
188
|
segment_path = (
|
173
|
-
self.
|
189
|
+
self.temp_directory
|
174
190
|
/ f"segment_{speaker}_{turn.start:.2f}_{turn.end:.2f}.wav"
|
175
191
|
)
|
176
|
-
if audio_processor.load_audio_segment(
|
177
|
-
|
192
|
+
if audio_processor.load_audio_segment(
|
193
|
+
audio_path, turn.start, turn.end, segment_path
|
194
|
+
):
|
195
|
+
transcription = self.whisper_model.transcribe(
|
196
|
+
str(segment_path)
|
197
|
+
)["text"]
|
178
198
|
segment_path.unlink(missing_ok=True)
|
179
199
|
|
180
200
|
line = f"[{turn.start:.2f}s - {turn.end:.2f}s] Speaker {speaker}: {transcription.strip()}\n"
|
181
201
|
f.write(line)
|
182
202
|
logger.info(line.strip())
|
183
203
|
|
184
|
-
# Update the progress bar
|
185
204
|
bar()
|
186
205
|
|
187
|
-
# Stop resource monitoring
|
188
206
|
self._running = False
|
189
207
|
resource_thread.join()
|
190
208
|
|
@@ -193,4 +211,4 @@ class TranscriptionPipeline:
|
|
193
211
|
|
194
212
|
except Exception as e:
|
195
213
|
logger.error(f"Processing failed: {e}")
|
196
|
-
return False
|
214
|
+
return False
|
audio_scribe/transcriber.py
CHANGED
@@ -31,20 +31,19 @@ logger = logging.getLogger(__name__)
|
|
31
31
|
|
32
32
|
def main():
|
33
33
|
"""Main entry point for the Audio Scribe CLI."""
|
34
|
-
print(
|
34
|
+
print(
|
35
|
+
"Initializing environment... Please wait while we load dependencies and models."
|
36
|
+
)
|
35
37
|
sys.stdout.flush()
|
36
38
|
|
37
39
|
parser = argparse.ArgumentParser(
|
38
40
|
description="Audio Transcription Pipeline using Whisper + Pyannote, with optional progress bar."
|
39
41
|
)
|
40
42
|
parser.add_argument(
|
41
|
-
"--audio",
|
42
|
-
type=Path,
|
43
|
-
help="Path to the audio file to transcribe."
|
43
|
+
"--audio", type=Path, help="Path to the audio file to transcribe."
|
44
44
|
)
|
45
45
|
parser.add_argument(
|
46
|
-
"--token",
|
47
|
-
help="HuggingFace API token. Overrides any saved token."
|
46
|
+
"--token", help="HuggingFace API token. Overrides any saved token."
|
48
47
|
)
|
49
48
|
parser.add_argument(
|
50
49
|
"--output",
|
@@ -70,7 +69,9 @@ def main():
|
|
70
69
|
|
71
70
|
# Manage user warnings
|
72
71
|
if not args.show_warnings:
|
73
|
-
warnings.filterwarnings(
|
72
|
+
warnings.filterwarnings(
|
73
|
+
"ignore", category=UserWarning, module=r"pyannote\.audio"
|
74
|
+
)
|
74
75
|
warnings.filterwarnings("ignore", category=FutureWarning, module="whisper")
|
75
76
|
else:
|
76
77
|
warnings.resetwarnings()
|
@@ -80,7 +81,7 @@ def main():
|
|
80
81
|
sys.exit(1)
|
81
82
|
|
82
83
|
# Initialize tab-completion for file paths
|
83
|
-
readline.set_completer_delims(
|
84
|
+
readline.set_completer_delims(" \t\n;")
|
84
85
|
readline.set_completer(complete_path)
|
85
86
|
readline.parse_and_bind("tab: complete")
|
86
87
|
|
@@ -93,10 +94,11 @@ def main():
|
|
93
94
|
sys.exit(0 if success else 1)
|
94
95
|
|
95
96
|
# Prepare configuration
|
96
|
-
output_dir = args.output or (
|
97
|
+
output_dir = args.output or (
|
98
|
+
Path("transcripts") / datetime.now().strftime("%Y%m%d")
|
99
|
+
)
|
97
100
|
config = TranscriptionConfig(
|
98
|
-
output_directory=output_dir,
|
99
|
-
whisper_model=args.whisper_model
|
101
|
+
output_directory=output_dir, whisper_model=args.whisper_model
|
100
102
|
)
|
101
103
|
|
102
104
|
# Initialize pipeline
|
@@ -114,7 +116,9 @@ def main():
|
|
114
116
|
# Prompt user for audio file path if not passed in
|
115
117
|
audio_path = args.audio
|
116
118
|
while not audio_path or not audio_path.exists():
|
117
|
-
audio_path_str = input(
|
119
|
+
audio_path_str = input(
|
120
|
+
"\nEnter path to audio file (Tab for autocomplete): "
|
121
|
+
).strip()
|
118
122
|
audio_path = Path(audio_path_str)
|
119
123
|
if not audio_path.exists():
|
120
124
|
print(f"File '{audio_path}' not found. Please try again.")
|
@@ -128,4 +132,4 @@ def main():
|
|
128
132
|
|
129
133
|
|
130
134
|
if __name__ == "__main__":
|
131
|
-
main()
|
135
|
+
main()
|
audio_scribe/utils.py
CHANGED
@@ -4,23 +4,25 @@ import os
|
|
4
4
|
import glob
|
5
5
|
import logging
|
6
6
|
import importlib.metadata
|
7
|
+
from typing import List, Optional, Dict
|
7
8
|
from importlib.metadata import PackageNotFoundError
|
8
9
|
|
9
10
|
logger = logging.getLogger(__name__)
|
10
11
|
|
11
|
-
|
12
|
+
|
13
|
+
def complete_path(text: str, state: int) -> Optional[str]:
|
12
14
|
"""
|
13
15
|
Return the 'state'-th completion for 'text'.
|
14
16
|
This function will be used by 'readline' to enable file path autocompletion.
|
15
17
|
"""
|
16
18
|
# If the user typed a glob pattern (with * or ?)
|
17
|
-
if
|
18
|
-
matches = sorted(glob.glob(text))
|
19
|
+
if "*" in text or "?" in text:
|
20
|
+
matches: List[str] = sorted(glob.glob(text))
|
19
21
|
else:
|
20
22
|
# Split off the directory name and partial file/directory name
|
21
23
|
directory, partial = os.path.split(text)
|
22
24
|
if not directory:
|
23
|
-
directory =
|
25
|
+
directory = "."
|
24
26
|
try:
|
25
27
|
# List everything in 'directory' that starts with 'partial'
|
26
28
|
entries = sorted(os.listdir(directory))
|
@@ -31,13 +33,13 @@ def complete_path(text, state):
|
|
31
33
|
matches = []
|
32
34
|
for entry in entries:
|
33
35
|
if entry.startswith(partial):
|
34
|
-
if directory ==
|
36
|
+
if directory == ".":
|
35
37
|
# Don't prefix current directory paths
|
36
38
|
full_path = entry
|
37
39
|
else:
|
38
40
|
# Keep the directory prefix for subdirectories
|
39
41
|
full_path = os.path.join(directory, entry)
|
40
|
-
|
42
|
+
|
41
43
|
# If it's a directory, add a trailing slash to indicate that
|
42
44
|
if os.path.isdir(full_path) and not full_path.endswith(os.path.sep):
|
43
45
|
full_path += os.path.sep
|
@@ -49,8 +51,8 @@ def complete_path(text, state):
|
|
49
51
|
|
50
52
|
class DependencyManager:
|
51
53
|
"""Manages and verifies system dependencies."""
|
52
|
-
|
53
|
-
REQUIRED_PACKAGES = {
|
54
|
+
|
55
|
+
REQUIRED_PACKAGES: Dict[str, Optional[str]] = {
|
54
56
|
"torch": None,
|
55
57
|
"pyannote.audio": None,
|
56
58
|
"openai-whisper": None,
|
@@ -64,8 +66,8 @@ class DependencyManager:
|
|
64
66
|
Verify all required dependencies are installed with correct versions.
|
65
67
|
Returns True if all are installed and correct, False otherwise.
|
66
68
|
"""
|
67
|
-
missing = []
|
68
|
-
outdated = []
|
69
|
+
missing: List[str] = []
|
70
|
+
outdated: List[str] = []
|
69
71
|
|
70
72
|
for package, required_version in cls.REQUIRED_PACKAGES.items():
|
71
73
|
try:
|
@@ -90,4 +92,4 @@ class DependencyManager:
|
|
90
92
|
),
|
91
93
|
)
|
92
94
|
return False
|
93
|
-
return True
|
95
|
+
return True
|
@@ -0,0 +1,201 @@
|
|
1
|
+
Apache License
|
2
|
+
Version 2.0, January 2004
|
3
|
+
http://www.apache.org/licenses/
|
4
|
+
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
6
|
+
|
7
|
+
1. Definitions.
|
8
|
+
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
11
|
+
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
13
|
+
the copyright owner that is granting the License.
|
14
|
+
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
16
|
+
other entities that control, are controlled by, or are under common
|
17
|
+
control with that entity. For the purposes of this definition,
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
19
|
+
direction or management of such entity, whether by contract or
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
22
|
+
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
24
|
+
exercising permissions granted by this License.
|
25
|
+
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
27
|
+
including but not limited to software source code, documentation
|
28
|
+
source, and configuration files.
|
29
|
+
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
31
|
+
transformation or translation of a Source form, including but
|
32
|
+
not limited to compiled object code, generated documentation,
|
33
|
+
and conversions to other media types.
|
34
|
+
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
36
|
+
Object form, made available under the License, as indicated by a
|
37
|
+
copyright notice that is included in or attached to the work
|
38
|
+
(an example is provided in the Appendix below).
|
39
|
+
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
46
|
+
the Work and Derivative Works thereof.
|
47
|
+
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
49
|
+
the original version of the Work and any modifications or additions
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
61
|
+
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
64
|
+
subsequently incorporated within the Work.
|
65
|
+
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
72
|
+
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
78
|
+
where such license applies only to those patent claims licensable
|
79
|
+
by such Contributor that are necessarily infringed by their
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
82
|
+
institute patent litigation against any entity (including a
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
85
|
+
or contributory patent infringement, then any patent licenses
|
86
|
+
granted to You under this License for that Work shall terminate
|
87
|
+
as of the date such litigation is filed.
|
88
|
+
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
91
|
+
modifications, and in Source or Object form, provided that You
|
92
|
+
meet the following conditions:
|
93
|
+
|
94
|
+
(a) You must give any other recipients of the Work or
|
95
|
+
Derivative Works a copy of this License; and
|
96
|
+
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
98
|
+
stating that You changed the files; and
|
99
|
+
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
102
|
+
attribution notices from the Source form of the Work,
|
103
|
+
excluding those notices that do not pertain to any part of
|
104
|
+
the Derivative Works; and
|
105
|
+
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
108
|
+
include a readable copy of the attribution notices contained
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
111
|
+
of the following places: within a NOTICE text file distributed
|
112
|
+
as part of the Derivative Works; within the Source form or
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
114
|
+
within a display generated by the Derivative Works, if and
|
115
|
+
wherever such third-party notices normally appear. The contents
|
116
|
+
of the NOTICE file are for informational purposes only and
|
117
|
+
do not modify the License. You may add Your own attribution
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
120
|
+
that such additional attribution notices cannot be construed
|
121
|
+
as modifying the License.
|
122
|
+
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
124
|
+
may provide additional or different license terms and conditions
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
128
|
+
the conditions stated in this License.
|
129
|
+
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
133
|
+
this License, without any additional terms or conditions.
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
135
|
+
the terms of any separate license agreement you may have executed
|
136
|
+
with Licensor regarding such Contributions.
|
137
|
+
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
140
|
+
except as required for reasonable and customary use in describing the
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
142
|
+
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
152
|
+
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
158
|
+
incidental, or consequential damages of any character arising as a
|
159
|
+
result of this License or out of the use or inability to use the
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
162
|
+
other commercial damages or losses), even if such Contributor
|
163
|
+
has been advised of the possibility of such damages.
|
164
|
+
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
168
|
+
or other liability obligations and/or rights consistent with this
|
169
|
+
License. However, in accepting such obligations, You may act only
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
174
|
+
of your accepting any such warranty or additional liability.
|
175
|
+
|
176
|
+
END OF TERMS AND CONDITIONS
|
177
|
+
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
179
|
+
|
180
|
+
To apply the Apache License to your work, attach the following
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
182
|
+
replaced with your own identifying information. (Don't include
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
184
|
+
comment syntax for the file format. We also recommend that a
|
185
|
+
file or class name and description of purpose be included on the
|
186
|
+
same "printed page" as the copyright notice for easier
|
187
|
+
identification within third-party archives.
|
188
|
+
|
189
|
+
Copyright 2025 Administrator
|
190
|
+
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
192
|
+
you may not use this file except in compliance with the License.
|
193
|
+
You may obtain a copy of the License at
|
194
|
+
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
196
|
+
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
200
|
+
See the License for the specific language governing permissions and
|
201
|
+
limitations under the License.
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.2
|
2
2
|
Name: audio_scribe
|
3
|
-
Version: 0.1.
|
3
|
+
Version: 0.1.4
|
4
4
|
Summary: A command-line tool for audio transcription with Whisper and Pyannote.
|
5
5
|
Home-page: https://gitlab.genomicops.cloud/genomicops/audio-scribe
|
6
6
|
Author: Gurasis Osahan
|
@@ -22,6 +22,7 @@ Classifier: Programming Language :: Python :: 3.10
|
|
22
22
|
Classifier: Operating System :: OS Independent
|
23
23
|
Requires-Python: >=3.8
|
24
24
|
Description-Content-Type: text/markdown
|
25
|
+
License-File: LICENSE
|
25
26
|
Requires-Dist: torch
|
26
27
|
Requires-Dist: openai-whisper
|
27
28
|
Requires-Dist: pyannote.audio
|
@@ -47,15 +48,35 @@ Dynamic: summary
|
|
47
48
|
# Audio Scribe
|
48
49
|
|
49
50
|
**A Command-Line Tool for Audio Transcription and Speaker Diarization Using OpenAI Whisper and Pyannote**
|
51
|
+
---
|
50
52
|
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
53
|
+
<p align="center" style="margin: 0px auto;">
|
54
|
+
<img src="https://img.shields.io/gitlab/pipeline-status/innovation-hub%2Faudio-scribe?gitlab_url=https%3A%2F%2Fgitlab.genomicops.cloud&style=for-the-badge&logo=gitlab&logoColor=white&color=green" alt="Pipeline Status">
|
55
|
+
<img src="https://img.shields.io/gitlab/pipeline-coverage/innovation-hub%2Faudio-scribe?gitlab_url=https%3A%2F%2Fgitlab.genomicops.cloud&style=for-the-badge&logo=tag&logoColor=white&color=red" alt="Coverage">
|
56
|
+
<img src="https://img.shields.io/pypi/pyversions/audio-scribe?style=for-the-badge&logo=python&logoColor=white&logoWidth=30&color=yellow" alt="Python Versions">
|
57
|
+
<img src="https://img.shields.io/pypi/dm/audio-scribe?style=for-the-badge&logo=pypi&logoColor=white&logoWidth=30&color=orange" alt="PyPI Downloads">
|
58
|
+
<img src="https://img.shields.io/gitlab/v/tag/innovation-hub%2Faudio-scribe?gitlab_url=https%3A%2F%2Fgitlab.genomicops.cloud&style=for-the-badge&logo=tag&logoColor=white&color=red" alt="Version">
|
59
|
+
<img src="https://img.shields.io/gitlab/license/innovation-hub%2Faudio-scribe?gitlab_url=https%3A%2F%2Fgitlab.genomicops.cloud%2F&style=for-the-badge&logo=apache&logoColor=white&color=orange" alt="License">
|
60
|
+
<img src="https://img.shields.io/gitlab/contributors/innovation-hub%2Faudio-scribe?gitlab_url=https%3A%2F%2Fgitlab.genomicops.cloud&style=for-the-badge&logo=users&logoColor=white&color=purple" alt="Contributors">
|
61
|
+
<img src="https://img.shields.io/gitlab/issues/all/innovation-hub%2Faudio-scribe?gitlab_url=https%3A%2F%2Fgitlab.genomicops.cloud&style=for-the-badge&logo=issue-opened&logoColor=white&color=yellow" alt="Issues">
|
62
|
+
<img src="https://img.shields.io/gitlab/last-commit/innovation-hub%2Faudio-scribe?gitlab_url=https%3A%2F%2Fgitlab.genomicops.cloud%2F&style=for-the-badge&logo=clock&logoColor=white&color=blue" alt="Last Commit">
|
63
|
+
<a href="https://buymeacoffee.com/gosahan" target="_blank">
|
64
|
+
<img src="https://img.shields.io/badge/Buy%20Me%20A%20Coffee-Support-yellow?style=for-the-badge&logo=buymeacoffee&logoColor=white" alt="Buy Me A Coffee Badge"/>
|
65
|
+
</a>
|
66
|
+
</p>
|
67
|
+
|
68
|
+
## Support the Project ☕
|
69
|
+
|
70
|
+
<p align="center">
|
71
|
+
<a href="https://www.buymeacoffee.com/gosahan" target="_blank">
|
72
|
+
<img src="https://cdn.buymeacoffee.com/buttons/v2/default-green.png" alt="Buy Me A Coffee" height="60">
|
73
|
+
</a>
|
74
|
+
</p>
|
75
|
+
|
76
|
+
<p align="center">
|
77
|
+
If you find Audio Scribe helpful, consider supporting the project with a coffee!<br>
|
78
|
+
Your contribution helps maintain the project and develop new features.
|
79
|
+
</p>
|
59
80
|
|
60
81
|
## Overview
|
61
82
|
|
@@ -74,6 +95,8 @@ This repository is licensed under the [Apache License 2.0](#license).
|
|
74
95
|
## Table of Contents
|
75
96
|
|
76
97
|
- [Audio Scribe](#audio-scribe)
|
98
|
+
- [**A Command-Line Tool for Audio Transcription and Speaker Diarization Using OpenAI Whisper and Pyannote**](#a-command-line-tool-for-audio-transcription-and-speaker-diarization-using-openai-whisper-and-pyannote)
|
99
|
+
- [Support the Project ☕](#support-the-project-)
|
77
100
|
- [Overview](#overview)
|
78
101
|
- [Table of Contents](#table-of-contents)
|
79
102
|
- [Features](#features)
|
@@ -127,7 +150,7 @@ python -m audio-scribe --audio path/to/yourfile.wav
|
|
127
150
|
To install the latest development version directly from GitHub:
|
128
151
|
|
129
152
|
```bash
|
130
|
-
git clone https://gitlab.genomicops.cloud/
|
153
|
+
git clone https://gitlab.genomicops.cloud/innovation-hub/audio-scribe.git
|
131
154
|
cd audio-scribe
|
132
155
|
pip install -r requirements.txt
|
133
156
|
```
|
@@ -277,4 +300,4 @@ limitations under the License.
|
|
277
300
|
---
|
278
301
|
|
279
302
|
**Thank you for using Audio Scribe!**
|
280
|
-
For questions or feedback, please open a [GitHub issue](https://gitlab.genomicops.cloud/
|
303
|
+
For questions or feedback, please open a [GitHub issue](https://gitlab.genomicops.cloud/innovation-hub/audio-scribe/-/issues) or contact the maintainers.
|
@@ -0,0 +1,12 @@
|
|
1
|
+
audio_scribe/__init__.py,sha256=S5ueFV0RdXthtYvK6it6nzLLPoktQwFOZxRPaupXqWY,544
|
2
|
+
audio_scribe/auth.py,sha256=XR26nTvhof9yvkNgKESy5oWjZRS8mmGuZ-MJ7UysTHE,4355
|
3
|
+
audio_scribe/config.py,sha256=lKiBamkPf7YEx04P6zQX9uJydRkids8h2kWmuxMJWYM,938
|
4
|
+
audio_scribe/models.py,sha256=4N2MoLL9ZeU5ojp2JJq0tD54-yxNcgLp2-CAFwzg2w0,8423
|
5
|
+
audio_scribe/transcriber.py,sha256=Du8V9q9YhXXFZjKyd-Brs-8mH2FQtpjxGWyzXAkuJnw,4064
|
6
|
+
audio_scribe/utils.py,sha256=LYoTqFBwYMgYs0-BtE4Aq_271vWYhRyjhlKB26SzIOI,3386
|
7
|
+
audio_scribe-0.1.4.dist-info/LICENSE,sha256=TiyEjWfqvme6M3rcTYz949_eYuikTXC6RWry7vcCiCQ,11343
|
8
|
+
audio_scribe-0.1.4.dist-info/METADATA,sha256=cj0jZtOTBD6vqeMRE3Ls33aasfk333xMkV3Re-4-aUM,12205
|
9
|
+
audio_scribe-0.1.4.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
10
|
+
audio_scribe-0.1.4.dist-info/entry_points.txt,sha256=Bj7Co8Er22Ux59Vs2_S63ds2bnwDURvhHYNXVviZdPM,63
|
11
|
+
audio_scribe-0.1.4.dist-info/top_level.txt,sha256=L1mltKt-5HrbTXPpAXwht8SXQCgcCceoqpCq4OCZRsk,13
|
12
|
+
audio_scribe-0.1.4.dist-info/RECORD,,
|
@@ -1,11 +0,0 @@
|
|
1
|
-
audio_scribe/__init__.py,sha256=FH63cMQOjdp5Kp9JTAl-uaQbtEVh-lKneUJRKl5hEXc,543
|
2
|
-
audio_scribe/auth.py,sha256=YD9ElcMtFIMMYW26XZqMCzpYjOsmXkS5-TC2hTmCOEw,4351
|
3
|
-
audio_scribe/config.py,sha256=umD9-QBfi4e5RZG33lCOpdLBBbriG0LFyyDwvgHlSlQ,935
|
4
|
-
audio_scribe/models.py,sha256=Z5eJJf7rxq6k60fJMfVW98jwB9MDT7JxKBVvFmXZN-Q,7971
|
5
|
-
audio_scribe/transcriber.py,sha256=xMWt50QmNXeLhpTZhJlLtmJSzeOcRSWKtYRMJghjUnI,4026
|
6
|
-
audio_scribe/utils.py,sha256=iKt0ZZKF_Jmo7WNKJxldOHlwo__afEWuYWi_ckNd9gU,3278
|
7
|
-
audio_scribe-0.1.2.dist-info/METADATA,sha256=sKvgdqqlHZ9fqlwJu-sXCDdpqAFKVBsis8BHq0Q6yyU,10355
|
8
|
-
audio_scribe-0.1.2.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
9
|
-
audio_scribe-0.1.2.dist-info/entry_points.txt,sha256=Bj7Co8Er22Ux59Vs2_S63ds2bnwDURvhHYNXVviZdPM,63
|
10
|
-
audio_scribe-0.1.2.dist-info/top_level.txt,sha256=L1mltKt-5HrbTXPpAXwht8SXQCgcCceoqpCq4OCZRsk,13
|
11
|
-
audio_scribe-0.1.2.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|