Update app.py
Browse files
app.py
CHANGED
@@ -166,7 +166,6 @@ app.layout = dbc.Container([
|
|
166 |
html.H1("Video Transcription", className="text-center mb-4"),
|
167 |
dbc.Card([
|
168 |
dbc.CardBody([
|
169 |
-
dbc.Input(id="hf-token", type="password", placeholder="Enter Hugging Face Token", className="mb-3"),
|
170 |
dbc.Input(id="video-url", type="text", placeholder="Enter video URL"),
|
171 |
dbc.Button("Transcribe", id="transcribe-button", color="primary", className="mt-3"),
|
172 |
dbc.Spinner(html.Div(id="transcription-output", className="mt-3")),
|
@@ -181,18 +180,17 @@ app.layout = dbc.Container([
|
|
181 |
Output("transcription-output", "children"),
|
182 |
Output("download-transcript", "data"),
|
183 |
Input("transcribe-button", "n_clicks"),
|
184 |
-
State("hf-token", "value"),
|
185 |
State("video-url", "value"),
|
186 |
prevent_initial_call=True
|
187 |
)
|
188 |
-
def update_transcription(n_clicks,
|
189 |
-
if not url
|
190 |
raise PreventUpdate
|
191 |
|
192 |
def transcribe():
|
193 |
try:
|
194 |
-
# Initialize the speaker diarization pipeline
|
195 |
-
pipeline = Pipeline.from_pretrained("collinbarnwell/pyannote-speaker-diarization-31"
|
196 |
if pipeline is None:
|
197 |
raise ValueError("Failed to initialize the speaker diarization pipeline")
|
198 |
print("Speaker diarization pipeline initialized successfully")
|
|
|
166 |
html.H1("Video Transcription", className="text-center mb-4"),
|
167 |
dbc.Card([
|
168 |
dbc.CardBody([
|
|
|
169 |
dbc.Input(id="video-url", type="text", placeholder="Enter video URL"),
|
170 |
dbc.Button("Transcribe", id="transcribe-button", color="primary", className="mt-3"),
|
171 |
dbc.Spinner(html.Div(id="transcription-output", className="mt-3")),
|
|
|
180 |
Output("transcription-output", "children"),
|
181 |
Output("download-transcript", "data"),
|
182 |
Input("transcribe-button", "n_clicks"),
|
|
|
183 |
State("video-url", "value"),
|
184 |
prevent_initial_call=True
|
185 |
)
|
186 |
+
def update_transcription(n_clicks, url):
|
187 |
+
if not url:
|
188 |
raise PreventUpdate
|
189 |
|
190 |
def transcribe():
|
191 |
try:
|
192 |
+
# Initialize the speaker diarization pipeline without token
|
193 |
+
pipeline = Pipeline.from_pretrained("collinbarnwell/pyannote-speaker-diarization-31")
|
194 |
if pipeline is None:
|
195 |
raise ValueError("Failed to initialize the speaker diarization pipeline")
|
196 |
print("Speaker diarization pipeline initialized successfully")
|