Spaces:
Sleeping
Sleeping
Commit ·
1333284
1
Parent(s): ce8528d
Fixes
Browse files- app.py +4 -5
- poetry.lock +113 -127
- src/whisper.py +11 -3
app.py
CHANGED
|
@@ -140,11 +140,10 @@ with gr.Blocks(title="Transcription & Diarization") as app:
|
|
| 140 |
|
| 141 |
with gr.Column():
|
| 142 |
with gr.Group():
|
| 143 |
-
|
| 144 |
-
output_vtt = gr.Textbox(
|
| 145 |
label="Transcription",
|
| 146 |
-
|
| 147 |
-
|
| 148 |
)
|
| 149 |
|
| 150 |
validation_status = gr.Markdown("⚪ No content", container=True)
|
|
@@ -243,7 +242,7 @@ with gr.Blocks(title="Transcription & Diarization") as app:
|
|
| 243 |
|
| 244 |
# Real-time VTT validation and button state management
|
| 245 |
# We need to update validation whenever VTT content OR filename changes
|
| 246 |
-
output_vtt.
|
| 247 |
fn=update_validation,
|
| 248 |
inputs=[output_vtt, audio_filename_state],
|
| 249 |
outputs=[validation_status, download_btn],
|
|
|
|
| 140 |
|
| 141 |
with gr.Column():
|
| 142 |
with gr.Group():
|
| 143 |
+
output_vtt = gr.Code(
|
|
|
|
| 144 |
label="Transcription",
|
| 145 |
+
max_lines=40,
|
| 146 |
+
wrap_lines=True,
|
| 147 |
)
|
| 148 |
|
| 149 |
validation_status = gr.Markdown("⚪ No content", container=True)
|
|
|
|
| 242 |
|
| 243 |
# Real-time VTT validation and button state management
|
| 244 |
# We need to update validation whenever VTT content OR filename changes
|
| 245 |
+
output_vtt.input(
|
| 246 |
fn=update_validation,
|
| 247 |
inputs=[output_vtt, audio_filename_state],
|
| 248 |
outputs=[validation_status, download_btn],
|
poetry.lock
CHANGED
|
@@ -860,14 +860,14 @@ files = [
|
|
| 860 |
|
| 861 |
[[package]]
|
| 862 |
name = "fastapi"
|
| 863 |
-
version = "0.
|
| 864 |
description = "FastAPI framework, high performance, easy to learn, fast to code, ready for production"
|
| 865 |
optional = false
|
| 866 |
python-versions = ">=3.8"
|
| 867 |
groups = ["main"]
|
| 868 |
files = [
|
| 869 |
-
{file = "fastapi-0.
|
| 870 |
-
{file = "fastapi-0.
|
| 871 |
]
|
| 872 |
|
| 873 |
[package.dependencies]
|
|
@@ -1192,14 +1192,14 @@ grpc = ["grpcio (>=1.44.0,<2.0.0)"]
|
|
| 1192 |
|
| 1193 |
[[package]]
|
| 1194 |
name = "gradio"
|
| 1195 |
-
version = "6.0.
|
| 1196 |
description = "Python library for easily interacting with trained machine learning models"
|
| 1197 |
optional = false
|
| 1198 |
python-versions = ">=3.10"
|
| 1199 |
groups = ["main"]
|
| 1200 |
files = [
|
| 1201 |
-
{file = "gradio-6.0.
|
| 1202 |
-
{file = "gradio-6.0.
|
| 1203 |
]
|
| 1204 |
|
| 1205 |
[package.dependencies]
|
|
@@ -1209,7 +1209,7 @@ audioop-lts = {version = "<1.0", markers = "python_version >= \"3.13\""}
|
|
| 1209 |
brotli = ">=1.1.0"
|
| 1210 |
fastapi = ">=0.115.2,<1.0"
|
| 1211 |
ffmpy = "*"
|
| 1212 |
-
gradio-client = "2.0.0
|
| 1213 |
groovy = ">=0.1,<1.0"
|
| 1214 |
httpx = ">=0.24.1,<1.0"
|
| 1215 |
huggingface-hub = ">=0.33.5,<2.0"
|
|
@@ -1219,7 +1219,7 @@ numpy = ">=1.0,<3.0"
|
|
| 1219 |
orjson = ">=3.0,<4.0"
|
| 1220 |
packaging = "*"
|
| 1221 |
pandas = ">=1.0,<3.0"
|
| 1222 |
-
pillow = ">=8.0,<
|
| 1223 |
pydantic = ">=2.11.10,<=2.12.4"
|
| 1224 |
pydub = "*"
|
| 1225 |
python-multipart = ">=0.0.18"
|
|
@@ -1238,14 +1238,14 @@ oauth = ["authlib", "itsdangerous"]
|
|
| 1238 |
|
| 1239 |
[[package]]
|
| 1240 |
name = "gradio-client"
|
| 1241 |
-
version = "2.0.0
|
| 1242 |
description = "Python library for easily interacting with trained machine learning models"
|
| 1243 |
optional = false
|
| 1244 |
python-versions = ">=3.10"
|
| 1245 |
groups = ["main"]
|
| 1246 |
files = [
|
| 1247 |
-
{file = "gradio_client-2.0.0
|
| 1248 |
-
{file = "gradio_client-2.0.0.
|
| 1249 |
]
|
| 1250 |
|
| 1251 |
[package.dependencies]
|
|
@@ -2334,22 +2334,24 @@ files = [
|
|
| 2334 |
|
| 2335 |
[[package]]
|
| 2336 |
name = "networkx"
|
| 2337 |
-
version = "3.
|
| 2338 |
description = "Python package for creating and manipulating graphs and networks"
|
| 2339 |
optional = false
|
| 2340 |
python-versions = ">=3.11"
|
| 2341 |
groups = ["main"]
|
| 2342 |
files = [
|
| 2343 |
-
{file = "networkx-3.
|
| 2344 |
-
{file = "networkx-3.
|
| 2345 |
]
|
| 2346 |
|
| 2347 |
[package.extras]
|
|
|
|
| 2348 |
default = ["matplotlib (>=3.8)", "numpy (>=1.25)", "pandas (>=2.0)", "scipy (>=1.11.2)"]
|
| 2349 |
developer = ["mypy (>=1.15)", "pre-commit (>=4.1)"]
|
| 2350 |
doc = ["intersphinx-registry", "myst-nb (>=1.1)", "numpydoc (>=1.8.0)", "pillow (>=10)", "pydata-sphinx-theme (>=0.16)", "sphinx (>=8.0)", "sphinx-gallery (>=0.18)", "texext (>=0.6.7)"]
|
| 2351 |
-
example = ["cairocffi (>=1.7)", "contextily (>=1.6)", "igraph (>=0.11)", "momepy (>=0.7.2)", "osmnx (>=2.0.0)", "scikit-learn (>=1.5)", "seaborn (>=0.13)"]
|
| 2352 |
extra = ["lxml (>=4.6)", "pydot (>=3.0.1)", "pygraphviz (>=1.14)", "sympy (>=1.10)"]
|
|
|
|
| 2353 |
test = ["pytest (>=7.2)", "pytest-cov (>=4.0)", "pytest-xdist (>=3.0)"]
|
| 2354 |
test-extras = ["pytest-mpl", "pytest-randomly"]
|
| 2355 |
|
|
@@ -3051,127 +3053,111 @@ xml = ["lxml (>=4.9.2)"]
|
|
| 3051 |
|
| 3052 |
[[package]]
|
| 3053 |
name = "pillow"
|
| 3054 |
-
version = "
|
| 3055 |
-
description = "Python Imaging Library (
|
| 3056 |
optional = false
|
| 3057 |
-
python-versions = ">=3.
|
| 3058 |
groups = ["main"]
|
| 3059 |
files = [
|
| 3060 |
-
{file = "pillow-
|
| 3061 |
-
{file = "pillow-
|
| 3062 |
-
{file = "pillow-
|
| 3063 |
-
{file = "pillow-
|
| 3064 |
-
{file = "pillow-
|
| 3065 |
-
{file = "pillow-
|
| 3066 |
-
{file = "pillow-
|
| 3067 |
-
{file = "pillow-
|
| 3068 |
-
{file = "pillow-
|
| 3069 |
-
{file = "pillow-
|
| 3070 |
-
{file = "pillow-
|
| 3071 |
-
{file = "pillow-
|
| 3072 |
-
{file = "pillow-
|
| 3073 |
-
{file = "pillow-
|
| 3074 |
-
{file = "pillow-
|
| 3075 |
-
{file = "pillow-
|
| 3076 |
-
{file = "pillow-
|
| 3077 |
-
{file = "pillow-
|
| 3078 |
-
{file = "pillow-
|
| 3079 |
-
{file = "pillow-
|
| 3080 |
-
{file = "pillow-
|
| 3081 |
-
{file = "pillow-
|
| 3082 |
-
{file = "pillow-
|
| 3083 |
-
{file = "pillow-
|
| 3084 |
-
{file = "pillow-
|
| 3085 |
-
{file = "pillow-
|
| 3086 |
-
{file = "pillow-
|
| 3087 |
-
{file = "pillow-
|
| 3088 |
-
{file = "pillow-
|
| 3089 |
-
{file = "pillow-
|
| 3090 |
-
{file = "pillow-
|
| 3091 |
-
{file = "pillow-
|
| 3092 |
-
{file = "pillow-
|
| 3093 |
-
{file = "pillow-
|
| 3094 |
-
{file = "pillow-
|
| 3095 |
-
{file = "pillow-
|
| 3096 |
-
{file = "pillow-
|
| 3097 |
-
{file = "pillow-
|
| 3098 |
-
{file = "pillow-
|
| 3099 |
-
{file = "pillow-
|
| 3100 |
-
{file = "pillow-
|
| 3101 |
-
{file = "pillow-
|
| 3102 |
-
{file = "pillow-
|
| 3103 |
-
{file = "pillow-
|
| 3104 |
-
{file = "pillow-
|
| 3105 |
-
{file = "pillow-
|
| 3106 |
-
{file = "pillow-
|
| 3107 |
-
{file = "pillow-
|
| 3108 |
-
{file = "pillow-
|
| 3109 |
-
{file = "pillow-
|
| 3110 |
-
{file = "pillow-
|
| 3111 |
-
{file = "pillow-
|
| 3112 |
-
{file = "pillow-
|
| 3113 |
-
{file = "pillow-
|
| 3114 |
-
{file = "pillow-
|
| 3115 |
-
{file = "pillow-
|
| 3116 |
-
{file = "pillow-
|
| 3117 |
-
{file = "pillow-
|
| 3118 |
-
{file = "pillow-
|
| 3119 |
-
{file = "pillow-
|
| 3120 |
-
{file = "pillow-
|
| 3121 |
-
{file = "pillow-
|
| 3122 |
-
{file = "pillow-
|
| 3123 |
-
{file = "pillow-
|
| 3124 |
-
{file = "pillow-
|
| 3125 |
-
{file = "pillow-
|
| 3126 |
-
{file = "pillow-
|
| 3127 |
-
{file = "pillow-
|
| 3128 |
-
{file = "pillow-
|
| 3129 |
-
{file = "pillow-
|
| 3130 |
-
{file = "pillow-
|
| 3131 |
-
{file = "pillow-
|
| 3132 |
-
{file = "pillow-
|
| 3133 |
-
{file = "pillow-
|
| 3134 |
-
{file = "pillow-
|
| 3135 |
-
{file = "pillow-
|
| 3136 |
-
{file = "pillow-
|
| 3137 |
-
{file = "pillow-
|
| 3138 |
-
{file = "pillow-
|
| 3139 |
-
{file = "pillow-
|
| 3140 |
-
{file = "pillow-
|
| 3141 |
-
{file = "pillow-
|
| 3142 |
-
{file = "pillow-
|
| 3143 |
-
{file = "pillow-
|
| 3144 |
-
{file = "pillow-
|
| 3145 |
-
{file = "pillow-
|
| 3146 |
-
{file = "pillow-
|
| 3147 |
-
{file = "pillow-
|
| 3148 |
-
{file = "pillow-
|
| 3149 |
-
{file = "pillow-
|
| 3150 |
-
{file = "pillow-
|
| 3151 |
-
{file = "pillow-11.3.0-pp310-pypy310_pp73-macosx_10_15_x86_64.whl", hash = "sha256:3cee80663f29e3843b68199b9d6f4f54bd1d4a6b59bdd91bceefc51238bcb967"},
|
| 3152 |
-
{file = "pillow-11.3.0-pp310-pypy310_pp73-macosx_11_0_arm64.whl", hash = "sha256:b5f56c3f344f2ccaf0dd875d3e180f631dc60a51b314295a3e681fe8cf851fbe"},
|
| 3153 |
-
{file = "pillow-11.3.0-pp310-pypy310_pp73-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:e67d793d180c9df62f1f40aee3accca4829d3794c95098887edc18af4b8b780c"},
|
| 3154 |
-
{file = "pillow-11.3.0-pp310-pypy310_pp73-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:d000f46e2917c705e9fb93a3606ee4a819d1e3aa7a9b442f6444f07e77cf5e25"},
|
| 3155 |
-
{file = "pillow-11.3.0-pp310-pypy310_pp73-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:527b37216b6ac3a12d7838dc3bd75208ec57c1c6d11ef01902266a5a0c14fc27"},
|
| 3156 |
-
{file = "pillow-11.3.0-pp310-pypy310_pp73-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:be5463ac478b623b9dd3937afd7fb7ab3d79dd290a28e2b6df292dc75063eb8a"},
|
| 3157 |
-
{file = "pillow-11.3.0-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:8dc70ca24c110503e16918a658b869019126ecfe03109b754c402daff12b3d9f"},
|
| 3158 |
-
{file = "pillow-11.3.0-pp311-pypy311_pp73-macosx_10_15_x86_64.whl", hash = "sha256:7c8ec7a017ad1bd562f93dbd8505763e688d388cde6e4a010ae1486916e713e6"},
|
| 3159 |
-
{file = "pillow-11.3.0-pp311-pypy311_pp73-macosx_11_0_arm64.whl", hash = "sha256:9ab6ae226de48019caa8074894544af5b53a117ccb9d3b3dcb2871464c829438"},
|
| 3160 |
-
{file = "pillow-11.3.0-pp311-pypy311_pp73-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:fe27fb049cdcca11f11a7bfda64043c37b30e6b91f10cb5bab275806c32f6ab3"},
|
| 3161 |
-
{file = "pillow-11.3.0-pp311-pypy311_pp73-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:465b9e8844e3c3519a983d58b80be3f668e2a7a5db97f2784e7079fbc9f9822c"},
|
| 3162 |
-
{file = "pillow-11.3.0-pp311-pypy311_pp73-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:5418b53c0d59b3824d05e029669efa023bbef0f3e92e75ec8428f3799487f361"},
|
| 3163 |
-
{file = "pillow-11.3.0-pp311-pypy311_pp73-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:504b6f59505f08ae014f724b6207ff6222662aab5cc9542577fb084ed0676ac7"},
|
| 3164 |
-
{file = "pillow-11.3.0-pp311-pypy311_pp73-win_amd64.whl", hash = "sha256:c84d689db21a1c397d001aa08241044aa2069e7587b398c8cc63020390b1c1b8"},
|
| 3165 |
-
{file = "pillow-11.3.0.tar.gz", hash = "sha256:3828ee7586cd0b2091b6209e5ad53e20d0649bbe87164a459d0676e035e8f523"},
|
| 3166 |
]
|
| 3167 |
|
| 3168 |
[package.extras]
|
| 3169 |
docs = ["furo", "olefile", "sphinx (>=8.2)", "sphinx-autobuild", "sphinx-copybutton", "sphinx-inline-tabs", "sphinxext-opengraph"]
|
| 3170 |
fpx = ["olefile"]
|
| 3171 |
mic = ["olefile"]
|
| 3172 |
-
test-arrow = ["pyarrow"]
|
| 3173 |
-
tests = ["check-manifest", "coverage (>=7.4.2)", "defusedxml", "markdown2", "olefile", "packaging", "pyroma", "pytest", "pytest-cov", "pytest-timeout", "pytest-xdist", "trove-classifiers (>=2024.10.12)"]
|
| 3174 |
-
typing = ["typing-extensions ; python_version < \"3.10\""]
|
| 3175 |
xmp = ["defusedxml"]
|
| 3176 |
|
| 3177 |
[[package]]
|
|
|
|
| 860 |
|
| 861 |
[[package]]
|
| 862 |
name = "fastapi"
|
| 863 |
+
version = "0.122.0"
|
| 864 |
description = "FastAPI framework, high performance, easy to learn, fast to code, ready for production"
|
| 865 |
optional = false
|
| 866 |
python-versions = ">=3.8"
|
| 867 |
groups = ["main"]
|
| 868 |
files = [
|
| 869 |
+
{file = "fastapi-0.122.0-py3-none-any.whl", hash = "sha256:a456e8915dfc6c8914a50d9651133bd47ec96d331c5b44600baa635538a30d67"},
|
| 870 |
+
{file = "fastapi-0.122.0.tar.gz", hash = "sha256:cd9b5352031f93773228af8b4c443eedc2ac2aa74b27780387b853c3726fb94b"},
|
| 871 |
]
|
| 872 |
|
| 873 |
[package.dependencies]
|
|
|
|
| 1192 |
|
| 1193 |
[[package]]
|
| 1194 |
name = "gradio"
|
| 1195 |
+
version = "6.0.1"
|
| 1196 |
description = "Python library for easily interacting with trained machine learning models"
|
| 1197 |
optional = false
|
| 1198 |
python-versions = ">=3.10"
|
| 1199 |
groups = ["main"]
|
| 1200 |
files = [
|
| 1201 |
+
{file = "gradio-6.0.1-py3-none-any.whl", hash = "sha256:0f98dc8b414a3f3773cbf3caf5a354507c8ae309ed8266e2f30ca9fa53f379b8"},
|
| 1202 |
+
{file = "gradio-6.0.1.tar.gz", hash = "sha256:5d02e6ac34c67aea26b938b8628c8f9f504871392e71f2db559ab8d6799bdf69"},
|
| 1203 |
]
|
| 1204 |
|
| 1205 |
[package.dependencies]
|
|
|
|
| 1209 |
brotli = ">=1.1.0"
|
| 1210 |
fastapi = ">=0.115.2,<1.0"
|
| 1211 |
ffmpy = "*"
|
| 1212 |
+
gradio-client = "2.0.0"
|
| 1213 |
groovy = ">=0.1,<1.0"
|
| 1214 |
httpx = ">=0.24.1,<1.0"
|
| 1215 |
huggingface-hub = ">=0.33.5,<2.0"
|
|
|
|
| 1219 |
orjson = ">=3.0,<4.0"
|
| 1220 |
packaging = "*"
|
| 1221 |
pandas = ">=1.0,<3.0"
|
| 1222 |
+
pillow = ">=8.0,<13.0"
|
| 1223 |
pydantic = ">=2.11.10,<=2.12.4"
|
| 1224 |
pydub = "*"
|
| 1225 |
python-multipart = ">=0.0.18"
|
|
|
|
| 1238 |
|
| 1239 |
[[package]]
|
| 1240 |
name = "gradio-client"
|
| 1241 |
+
version = "2.0.0"
|
| 1242 |
description = "Python library for easily interacting with trained machine learning models"
|
| 1243 |
optional = false
|
| 1244 |
python-versions = ">=3.10"
|
| 1245 |
groups = ["main"]
|
| 1246 |
files = [
|
| 1247 |
+
{file = "gradio_client-2.0.0-py3-none-any.whl", hash = "sha256:77bedf20edcc232d8e7986c1a22165b2bbca1c7c7df10ba808a093d5180dae18"},
|
| 1248 |
+
{file = "gradio_client-2.0.0.tar.gz", hash = "sha256:56b462183cb8741bd3e69b21db7d3b62c5abb03c2c2bb925223f1eb18f950e89"},
|
| 1249 |
]
|
| 1250 |
|
| 1251 |
[package.dependencies]
|
|
|
|
| 2334 |
|
| 2335 |
[[package]]
|
| 2336 |
name = "networkx"
|
| 2337 |
+
version = "3.6"
|
| 2338 |
description = "Python package for creating and manipulating graphs and networks"
|
| 2339 |
optional = false
|
| 2340 |
python-versions = ">=3.11"
|
| 2341 |
groups = ["main"]
|
| 2342 |
files = [
|
| 2343 |
+
{file = "networkx-3.6-py3-none-any.whl", hash = "sha256:cdb395b105806062473d3be36458d8f1459a4e4b98e236a66c3a48996e07684f"},
|
| 2344 |
+
{file = "networkx-3.6.tar.gz", hash = "sha256:285276002ad1f7f7da0f7b42f004bcba70d381e936559166363707fdad3d72ad"},
|
| 2345 |
]
|
| 2346 |
|
| 2347 |
[package.extras]
|
| 2348 |
+
benchmarking = ["asv", "virtualenv"]
|
| 2349 |
default = ["matplotlib (>=3.8)", "numpy (>=1.25)", "pandas (>=2.0)", "scipy (>=1.11.2)"]
|
| 2350 |
developer = ["mypy (>=1.15)", "pre-commit (>=4.1)"]
|
| 2351 |
doc = ["intersphinx-registry", "myst-nb (>=1.1)", "numpydoc (>=1.8.0)", "pillow (>=10)", "pydata-sphinx-theme (>=0.16)", "sphinx (>=8.0)", "sphinx-gallery (>=0.18)", "texext (>=0.6.7)"]
|
| 2352 |
+
example = ["cairocffi (>=1.7)", "contextily (>=1.6)", "igraph (>=0.11)", "iplotx (>=0.9.0)", "momepy (>=0.7.2)", "osmnx (>=2.0.0)", "scikit-learn (>=1.5)", "seaborn (>=0.13)"]
|
| 2353 |
extra = ["lxml (>=4.6)", "pydot (>=3.0.1)", "pygraphviz (>=1.14)", "sympy (>=1.10)"]
|
| 2354 |
+
release = ["build (>=0.10)", "changelist (==0.5)", "twine (>=4.0)", "wheel (>=0.40)"]
|
| 2355 |
test = ["pytest (>=7.2)", "pytest-cov (>=4.0)", "pytest-xdist (>=3.0)"]
|
| 2356 |
test-extras = ["pytest-mpl", "pytest-randomly"]
|
| 2357 |
|
|
|
|
| 3053 |
|
| 3054 |
[[package]]
|
| 3055 |
name = "pillow"
|
| 3056 |
+
version = "12.0.0"
|
| 3057 |
+
description = "Python Imaging Library (fork)"
|
| 3058 |
optional = false
|
| 3059 |
+
python-versions = ">=3.10"
|
| 3060 |
groups = ["main"]
|
| 3061 |
files = [
|
| 3062 |
+
{file = "pillow-12.0.0-cp310-cp310-macosx_10_10_x86_64.whl", hash = "sha256:3adfb466bbc544b926d50fe8f4a4e6abd8c6bffd28a26177594e6e9b2b76572b"},
|
| 3063 |
+
{file = "pillow-12.0.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:1ac11e8ea4f611c3c0147424eae514028b5e9077dd99ab91e1bd7bc33ff145e1"},
|
| 3064 |
+
{file = "pillow-12.0.0-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:d49e2314c373f4c2b39446fb1a45ed333c850e09d0c59ac79b72eb3b95397363"},
|
| 3065 |
+
{file = "pillow-12.0.0-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:c7b2a63fd6d5246349f3d3f37b14430d73ee7e8173154461785e43036ffa96ca"},
|
| 3066 |
+
{file = "pillow-12.0.0-cp310-cp310-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:d64317d2587c70324b79861babb9c09f71fbb780bad212018874b2c013d8600e"},
|
| 3067 |
+
{file = "pillow-12.0.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:d77153e14b709fd8b8af6f66a3afbb9ed6e9fc5ccf0b6b7e1ced7b036a228782"},
|
| 3068 |
+
{file = "pillow-12.0.0-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:32ed80ea8a90ee3e6fa08c21e2e091bba6eda8eccc83dbc34c95169507a91f10"},
|
| 3069 |
+
{file = "pillow-12.0.0-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:c828a1ae702fc712978bda0320ba1b9893d99be0badf2647f693cc01cf0f04fa"},
|
| 3070 |
+
{file = "pillow-12.0.0-cp310-cp310-win32.whl", hash = "sha256:bd87e140e45399c818fac4247880b9ce719e4783d767e030a883a970be632275"},
|
| 3071 |
+
{file = "pillow-12.0.0-cp310-cp310-win_amd64.whl", hash = "sha256:455247ac8a4cfb7b9bc45b7e432d10421aea9fc2e74d285ba4072688a74c2e9d"},
|
| 3072 |
+
{file = "pillow-12.0.0-cp310-cp310-win_arm64.whl", hash = "sha256:6ace95230bfb7cd79ef66caa064bbe2f2a1e63d93471c3a2e1f1348d9f22d6b7"},
|
| 3073 |
+
{file = "pillow-12.0.0-cp311-cp311-macosx_10_10_x86_64.whl", hash = "sha256:0fd00cac9c03256c8b2ff58f162ebcd2587ad3e1f2e397eab718c47e24d231cc"},
|
| 3074 |
+
{file = "pillow-12.0.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:a3475b96f5908b3b16c47533daaa87380c491357d197564e0ba34ae75c0f3257"},
|
| 3075 |
+
{file = "pillow-12.0.0-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:110486b79f2d112cf6add83b28b627e369219388f64ef2f960fef9ebaf54c642"},
|
| 3076 |
+
{file = "pillow-12.0.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:5269cc1caeedb67e6f7269a42014f381f45e2e7cd42d834ede3c703a1d915fe3"},
|
| 3077 |
+
{file = "pillow-12.0.0-cp311-cp311-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:aa5129de4e174daccbc59d0a3b6d20eaf24417d59851c07ebb37aeb02947987c"},
|
| 3078 |
+
{file = "pillow-12.0.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:bee2a6db3a7242ea309aa7ee8e2780726fed67ff4e5b40169f2c940e7eb09227"},
|
| 3079 |
+
{file = "pillow-12.0.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:90387104ee8400a7b4598253b4c406f8958f59fcf983a6cea2b50d59f7d63d0b"},
|
| 3080 |
+
{file = "pillow-12.0.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:bc91a56697869546d1b8f0a3ff35224557ae7f881050e99f615e0119bf934b4e"},
|
| 3081 |
+
{file = "pillow-12.0.0-cp311-cp311-win32.whl", hash = "sha256:27f95b12453d165099c84f8a8bfdfd46b9e4bda9e0e4b65f0635430027f55739"},
|
| 3082 |
+
{file = "pillow-12.0.0-cp311-cp311-win_amd64.whl", hash = "sha256:b583dc9070312190192631373c6c8ed277254aa6e6084b74bdd0a6d3b221608e"},
|
| 3083 |
+
{file = "pillow-12.0.0-cp311-cp311-win_arm64.whl", hash = "sha256:759de84a33be3b178a64c8ba28ad5c135900359e85fb662bc6e403ad4407791d"},
|
| 3084 |
+
{file = "pillow-12.0.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:53561a4ddc36facb432fae7a9d8afbfaf94795414f5cdc5fc52f28c1dca90371"},
|
| 3085 |
+
{file = "pillow-12.0.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:71db6b4c1653045dacc1585c1b0d184004f0d7e694c7b34ac165ca70c0838082"},
|
| 3086 |
+
{file = "pillow-12.0.0-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:2fa5f0b6716fc88f11380b88b31fe591a06c6315e955c096c35715788b339e3f"},
|
| 3087 |
+
{file = "pillow-12.0.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:82240051c6ca513c616f7f9da06e871f61bfd7805f566275841af15015b8f98d"},
|
| 3088 |
+
{file = "pillow-12.0.0-cp312-cp312-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:55f818bd74fe2f11d4d7cbc65880a843c4075e0ac7226bc1a23261dbea531953"},
|
| 3089 |
+
{file = "pillow-12.0.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:b87843e225e74576437fd5b6a4c2205d422754f84a06942cfaf1dc32243e45a8"},
|
| 3090 |
+
{file = "pillow-12.0.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:c607c90ba67533e1b2355b821fef6764d1dd2cbe26b8c1005ae84f7aea25ff79"},
|
| 3091 |
+
{file = "pillow-12.0.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:21f241bdd5080a15bc86d3466a9f6074a9c2c2b314100dd896ac81ee6db2f1ba"},
|
| 3092 |
+
{file = "pillow-12.0.0-cp312-cp312-win32.whl", hash = "sha256:dd333073e0cacdc3089525c7df7d39b211bcdf31fc2824e49d01c6b6187b07d0"},
|
| 3093 |
+
{file = "pillow-12.0.0-cp312-cp312-win_amd64.whl", hash = "sha256:9fe611163f6303d1619bbcb653540a4d60f9e55e622d60a3108be0d5b441017a"},
|
| 3094 |
+
{file = "pillow-12.0.0-cp312-cp312-win_arm64.whl", hash = "sha256:7dfb439562f234f7d57b1ac6bc8fe7f838a4bd49c79230e0f6a1da93e82f1fad"},
|
| 3095 |
+
{file = "pillow-12.0.0-cp313-cp313-ios_13_0_arm64_iphoneos.whl", hash = "sha256:0869154a2d0546545cde61d1789a6524319fc1897d9ee31218eae7a60ccc5643"},
|
| 3096 |
+
{file = "pillow-12.0.0-cp313-cp313-ios_13_0_arm64_iphonesimulator.whl", hash = "sha256:a7921c5a6d31b3d756ec980f2f47c0cfdbce0fc48c22a39347a895f41f4a6ea4"},
|
| 3097 |
+
{file = "pillow-12.0.0-cp313-cp313-ios_13_0_x86_64_iphonesimulator.whl", hash = "sha256:1ee80a59f6ce048ae13cda1abf7fbd2a34ab9ee7d401c46be3ca685d1999a399"},
|
| 3098 |
+
{file = "pillow-12.0.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:c50f36a62a22d350c96e49ad02d0da41dbd17ddc2e29750dbdba4323f85eb4a5"},
|
| 3099 |
+
{file = "pillow-12.0.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:5193fde9a5f23c331ea26d0cf171fbf67e3f247585f50c08b3e205c7aeb4589b"},
|
| 3100 |
+
{file = "pillow-12.0.0-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:bde737cff1a975b70652b62d626f7785e0480918dece11e8fef3c0cf057351c3"},
|
| 3101 |
+
{file = "pillow-12.0.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:a6597ff2b61d121172f5844b53f21467f7082f5fb385a9a29c01414463f93b07"},
|
| 3102 |
+
{file = "pillow-12.0.0-cp313-cp313-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:0b817e7035ea7f6b942c13aa03bb554fc44fea70838ea21f8eb31c638326584e"},
|
| 3103 |
+
{file = "pillow-12.0.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:f4f1231b7dec408e8670264ce63e9c71409d9583dd21d32c163e25213ee2a344"},
|
| 3104 |
+
{file = "pillow-12.0.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:6e51b71417049ad6ab14c49608b4a24d8fb3fe605e5dfabfe523b58064dc3d27"},
|
| 3105 |
+
{file = "pillow-12.0.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:d120c38a42c234dc9a8c5de7ceaaf899cf33561956acb4941653f8bdc657aa79"},
|
| 3106 |
+
{file = "pillow-12.0.0-cp313-cp313-win32.whl", hash = "sha256:4cc6b3b2efff105c6a1656cfe59da4fdde2cda9af1c5e0b58529b24525d0a098"},
|
| 3107 |
+
{file = "pillow-12.0.0-cp313-cp313-win_amd64.whl", hash = "sha256:4cf7fed4b4580601c4345ceb5d4cbf5a980d030fd5ad07c4d2ec589f95f09905"},
|
| 3108 |
+
{file = "pillow-12.0.0-cp313-cp313-win_arm64.whl", hash = "sha256:9f0b04c6b8584c2c193babcccc908b38ed29524b29dd464bc8801bf10d746a3a"},
|
| 3109 |
+
{file = "pillow-12.0.0-cp313-cp313t-macosx_10_13_x86_64.whl", hash = "sha256:7fa22993bac7b77b78cae22bad1e2a987ddf0d9015c63358032f84a53f23cdc3"},
|
| 3110 |
+
{file = "pillow-12.0.0-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:f135c702ac42262573fe9714dfe99c944b4ba307af5eb507abef1667e2cbbced"},
|
| 3111 |
+
{file = "pillow-12.0.0-cp313-cp313t-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:c85de1136429c524e55cfa4e033b4a7940ac5c8ee4d9401cc2d1bf48154bbc7b"},
|
| 3112 |
+
{file = "pillow-12.0.0-cp313-cp313t-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:38df9b4bfd3db902c9c2bd369bcacaf9d935b2fff73709429d95cc41554f7b3d"},
|
| 3113 |
+
{file = "pillow-12.0.0-cp313-cp313t-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:7d87ef5795da03d742bf49439f9ca4d027cde49c82c5371ba52464aee266699a"},
|
| 3114 |
+
{file = "pillow-12.0.0-cp313-cp313t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:aff9e4d82d082ff9513bdd6acd4f5bd359f5b2c870907d2b0a9c5e10d40c88fe"},
|
| 3115 |
+
{file = "pillow-12.0.0-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:8d8ca2b210ada074d57fcee40c30446c9562e542fc46aedc19baf758a93532ee"},
|
| 3116 |
+
{file = "pillow-12.0.0-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:99a7f72fb6249302aa62245680754862a44179b545ded638cf1fef59befb57ef"},
|
| 3117 |
+
{file = "pillow-12.0.0-cp313-cp313t-win32.whl", hash = "sha256:4078242472387600b2ce8d93ade8899c12bf33fa89e55ec89fe126e9d6d5d9e9"},
|
| 3118 |
+
{file = "pillow-12.0.0-cp313-cp313t-win_amd64.whl", hash = "sha256:2c54c1a783d6d60595d3514f0efe9b37c8808746a66920315bfd34a938d7994b"},
|
| 3119 |
+
{file = "pillow-12.0.0-cp313-cp313t-win_arm64.whl", hash = "sha256:26d9f7d2b604cd23aba3e9faf795787456ac25634d82cd060556998e39c6fa47"},
|
| 3120 |
+
{file = "pillow-12.0.0-cp314-cp314-ios_13_0_arm64_iphoneos.whl", hash = "sha256:beeae3f27f62308f1ddbcfb0690bf44b10732f2ef43758f169d5e9303165d3f9"},
|
| 3121 |
+
{file = "pillow-12.0.0-cp314-cp314-ios_13_0_arm64_iphonesimulator.whl", hash = "sha256:d4827615da15cd59784ce39d3388275ec093ae3ee8d7f0c089b76fa87af756c2"},
|
| 3122 |
+
{file = "pillow-12.0.0-cp314-cp314-ios_13_0_x86_64_iphonesimulator.whl", hash = "sha256:3e42edad50b6909089750e65c91aa09aaf1e0a71310d383f11321b27c224ed8a"},
|
| 3123 |
+
{file = "pillow-12.0.0-cp314-cp314-macosx_10_15_x86_64.whl", hash = "sha256:e5d8efac84c9afcb40914ab49ba063d94f5dbdf5066db4482c66a992f47a3a3b"},
|
| 3124 |
+
{file = "pillow-12.0.0-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:266cd5f2b63ff316d5a1bba46268e603c9caf5606d44f38c2873c380950576ad"},
|
| 3125 |
+
{file = "pillow-12.0.0-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:58eea5ebe51504057dd95c5b77d21700b77615ab0243d8152793dc00eb4faf01"},
|
| 3126 |
+
{file = "pillow-12.0.0-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:f13711b1a5ba512d647a0e4ba79280d3a9a045aaf7e0cc6fbe96b91d4cdf6b0c"},
|
| 3127 |
+
{file = "pillow-12.0.0-cp314-cp314-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:6846bd2d116ff42cba6b646edf5bf61d37e5cbd256425fa089fee4ff5c07a99e"},
|
| 3128 |
+
{file = "pillow-12.0.0-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:c98fa880d695de164b4135a52fd2e9cd7b7c90a9d8ac5e9e443a24a95ef9248e"},
|
| 3129 |
+
{file = "pillow-12.0.0-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:fa3ed2a29a9e9d2d488b4da81dcb54720ac3104a20bf0bd273f1e4648aff5af9"},
|
| 3130 |
+
{file = "pillow-12.0.0-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:d034140032870024e6b9892c692fe2968493790dd57208b2c37e3fb35f6df3ab"},
|
| 3131 |
+
{file = "pillow-12.0.0-cp314-cp314-win32.whl", hash = "sha256:1b1b133e6e16105f524a8dec491e0586d072948ce15c9b914e41cdadd209052b"},
|
| 3132 |
+
{file = "pillow-12.0.0-cp314-cp314-win_amd64.whl", hash = "sha256:8dc232e39d409036af549c86f24aed8273a40ffa459981146829a324e0848b4b"},
|
| 3133 |
+
{file = "pillow-12.0.0-cp314-cp314-win_arm64.whl", hash = "sha256:d52610d51e265a51518692045e372a4c363056130d922a7351429ac9f27e70b0"},
|
| 3134 |
+
{file = "pillow-12.0.0-cp314-cp314t-macosx_10_15_x86_64.whl", hash = "sha256:1979f4566bb96c1e50a62d9831e2ea2d1211761e5662afc545fa766f996632f6"},
|
| 3135 |
+
{file = "pillow-12.0.0-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:b2e4b27a6e15b04832fe9bf292b94b5ca156016bbc1ea9c2c20098a0320d6cf6"},
|
| 3136 |
+
{file = "pillow-12.0.0-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:fb3096c30df99fd01c7bf8e544f392103d0795b9f98ba71a8054bcbf56b255f1"},
|
| 3137 |
+
{file = "pillow-12.0.0-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:7438839e9e053ef79f7112c881cef684013855016f928b168b81ed5835f3e75e"},
|
| 3138 |
+
{file = "pillow-12.0.0-cp314-cp314t-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:5d5c411a8eaa2299322b647cd932586b1427367fd3184ffbb8f7a219ea2041ca"},
|
| 3139 |
+
{file = "pillow-12.0.0-cp314-cp314t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:d7e091d464ac59d2c7ad8e7e08105eaf9dafbc3883fd7265ffccc2baad6ac925"},
|
| 3140 |
+
{file = "pillow-12.0.0-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:792a2c0be4dcc18af9d4a2dfd8a11a17d5e25274a1062b0ec1c2d79c76f3e7f8"},
|
| 3141 |
+
{file = "pillow-12.0.0-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:afbefa430092f71a9593a99ab6a4e7538bc9eabbf7bf94f91510d3503943edc4"},
|
| 3142 |
+
{file = "pillow-12.0.0-cp314-cp314t-win32.whl", hash = "sha256:3830c769decf88f1289680a59d4f4c46c72573446352e2befec9a8512104fa52"},
|
| 3143 |
+
{file = "pillow-12.0.0-cp314-cp314t-win_amd64.whl", hash = "sha256:905b0365b210c73afb0ebe9101a32572152dfd1c144c7e28968a331b9217b94a"},
|
| 3144 |
+
{file = "pillow-12.0.0-cp314-cp314t-win_arm64.whl", hash = "sha256:99353a06902c2e43b43e8ff74ee65a7d90307d82370604746738a1e0661ccca7"},
|
| 3145 |
+
{file = "pillow-12.0.0-pp311-pypy311_pp73-macosx_10_15_x86_64.whl", hash = "sha256:b22bd8c974942477156be55a768f7aa37c46904c175be4e158b6a86e3a6b7ca8"},
|
| 3146 |
+
{file = "pillow-12.0.0-pp311-pypy311_pp73-macosx_11_0_arm64.whl", hash = "sha256:805ebf596939e48dbb2e4922a1d3852cfc25c38160751ce02da93058b48d252a"},
|
| 3147 |
+
{file = "pillow-12.0.0-pp311-pypy311_pp73-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:cae81479f77420d217def5f54b5b9d279804d17e982e0f2fa19b1d1e14ab5197"},
|
| 3148 |
+
{file = "pillow-12.0.0-pp311-pypy311_pp73-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:aeaefa96c768fc66818730b952a862235d68825c178f1b3ffd4efd7ad2edcb7c"},
|
| 3149 |
+
{file = "pillow-12.0.0-pp311-pypy311_pp73-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:09f2d0abef9e4e2f349305a4f8cc784a8a6c2f58a8c4892eea13b10a943bd26e"},
|
| 3150 |
+
{file = "pillow-12.0.0-pp311-pypy311_pp73-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:bdee52571a343d721fb2eb3b090a82d959ff37fc631e3f70422e0c2e029f3e76"},
|
| 3151 |
+
{file = "pillow-12.0.0-pp311-pypy311_pp73-win_amd64.whl", hash = "sha256:b290fd8aa38422444d4b50d579de197557f182ef1068b75f5aa8558638b8d0a5"},
|
| 3152 |
+
{file = "pillow-12.0.0.tar.gz", hash = "sha256:87d4f8125c9988bfbed67af47dd7a953e2fc7b0cc1e7800ec6d2080d490bb353"},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3153 |
]
|
| 3154 |
|
| 3155 |
[package.extras]
|
| 3156 |
docs = ["furo", "olefile", "sphinx (>=8.2)", "sphinx-autobuild", "sphinx-copybutton", "sphinx-inline-tabs", "sphinxext-opengraph"]
|
| 3157 |
fpx = ["olefile"]
|
| 3158 |
mic = ["olefile"]
|
| 3159 |
+
test-arrow = ["arro3-compute", "arro3-core", "nanoarrow", "pyarrow"]
|
| 3160 |
+
tests = ["check-manifest", "coverage (>=7.4.2)", "defusedxml", "markdown2", "olefile", "packaging", "pyroma (>=5)", "pytest", "pytest-cov", "pytest-timeout", "pytest-xdist", "trove-classifiers (>=2024.10.12)"]
|
|
|
|
| 3161 |
xmp = ["defusedxml"]
|
| 3162 |
|
| 3163 |
[[package]]
|
src/whisper.py
CHANGED
|
@@ -6,6 +6,7 @@ from openai.types.audio import TranscriptionVerbose
|
|
| 6 |
from pyannote.pipeline import Pipeline
|
| 7 |
from pydantic import BaseModel
|
| 8 |
from pydub import AudioSegment
|
|
|
|
| 9 |
|
| 10 |
|
| 11 |
class TranscriptSegment(BaseModel):
|
|
@@ -25,7 +26,7 @@ def get_transcripts(
|
|
| 25 |
whisper_prompt: str,
|
| 26 |
whisper_language: str | None,
|
| 27 |
tmp_dir: Path,
|
| 28 |
-
progress_callback: Callable[[int, int], None] | None = None
|
| 29 |
) -> List[TranscriptSegment]:
|
| 30 |
client = OpenAI(api_key=openai_api_key)
|
| 31 |
|
|
@@ -35,7 +36,9 @@ def get_transcripts(
|
|
| 35 |
total_segments = sum(1 for _ in diarization.speaker_diarization.itertracks())
|
| 36 |
segment_index = 0
|
| 37 |
|
| 38 |
-
for turn, i, speaker in diarization.speaker_diarization.itertracks(
|
|
|
|
|
|
|
| 39 |
segment_index += 1
|
| 40 |
|
| 41 |
if progress_callback:
|
|
@@ -63,7 +66,12 @@ def get_transcripts(
|
|
| 63 |
if whisper_language:
|
| 64 |
params["language"] = whisper_language
|
| 65 |
|
| 66 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 67 |
|
| 68 |
transcripts.append(
|
| 69 |
TranscriptSegment(
|
|
|
|
| 6 |
from pyannote.pipeline import Pipeline
|
| 7 |
from pydantic import BaseModel
|
| 8 |
from pydub import AudioSegment
|
| 9 |
+
from openai import BadRequestError
|
| 10 |
|
| 11 |
|
| 12 |
class TranscriptSegment(BaseModel):
|
|
|
|
| 26 |
whisper_prompt: str,
|
| 27 |
whisper_language: str | None,
|
| 28 |
tmp_dir: Path,
|
| 29 |
+
progress_callback: Callable[[int, int], None] | None = None,
|
| 30 |
) -> List[TranscriptSegment]:
|
| 31 |
client = OpenAI(api_key=openai_api_key)
|
| 32 |
|
|
|
|
| 36 |
total_segments = sum(1 for _ in diarization.speaker_diarization.itertracks())
|
| 37 |
segment_index = 0
|
| 38 |
|
| 39 |
+
for turn, i, speaker in diarization.speaker_diarization.itertracks(
|
| 40 |
+
yield_label=True
|
| 41 |
+
):
|
| 42 |
segment_index += 1
|
| 43 |
|
| 44 |
if progress_callback:
|
|
|
|
| 66 |
if whisper_language:
|
| 67 |
params["language"] = whisper_language
|
| 68 |
|
| 69 |
+
try:
|
| 70 |
+
transcript = client.audio.transcriptions.create(**params)
|
| 71 |
+
except BadRequestError as e:
|
| 72 |
+
if "too short" in e.message.lower():
|
| 73 |
+
continue
|
| 74 |
+
raise
|
| 75 |
|
| 76 |
transcripts.append(
|
| 77 |
TranscriptSegment(
|