Update app.py
Browse files
app.py
CHANGED
|
@@ -12,6 +12,11 @@ import dash_bootstrap_components as dbc
|
|
| 12 |
from dash.exceptions import PreventUpdate
|
| 13 |
import threading
|
| 14 |
from pytube import YouTube
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 15 |
|
| 16 |
print("Script started")
|
| 17 |
|
|
@@ -148,6 +153,7 @@ app.layout = dbc.Container([
|
|
| 148 |
dbc.Row([
|
| 149 |
dbc.Col([
|
| 150 |
html.H1("Video Transcription with Speaker Separation", className="text-center mb-4"),
|
|
|
|
| 151 |
dbc.Card([
|
| 152 |
dbc.CardBody([
|
| 153 |
dbc.Input(id="video-url", type="text", placeholder="Enter video URL"),
|
|
@@ -179,8 +185,8 @@ def update_transcription(n_clicks, url):
|
|
| 179 |
transcript = transcribe_video(url)
|
| 180 |
return transcript
|
| 181 |
except Exception as e:
|
| 182 |
-
|
| 183 |
-
return f"An error occurred: {str(e)}
|
| 184 |
|
| 185 |
# Run transcription in a separate thread
|
| 186 |
thread = threading.Thread(target=transcribe)
|
|
@@ -216,6 +222,6 @@ def download_transcript(n_clicks, transcription_output):
|
|
| 216 |
return dict(content=transcript, filename="transcript.txt")
|
| 217 |
|
| 218 |
if __name__ == '__main__':
|
| 219 |
-
|
| 220 |
app.run(debug=True, host='0.0.0.0', port=7860)
|
| 221 |
-
|
|
|
|
| 12 |
from dash.exceptions import PreventUpdate
|
| 13 |
import threading
|
| 14 |
from pytube import YouTube
|
| 15 |
+
import logging
|
| 16 |
+
|
| 17 |
+
# Set up logging
|
| 18 |
+
logging.basicConfig(level=logging.DEBUG)
|
| 19 |
+
logger = logging.getLogger(__name__)
|
| 20 |
|
| 21 |
print("Script started")
|
| 22 |
|
|
|
|
| 153 |
dbc.Row([
|
| 154 |
dbc.Col([
|
| 155 |
html.H1("Video Transcription with Speaker Separation", className="text-center mb-4"),
|
| 156 |
+
html.Div("If you can see this, the app is working!", className="text-center mb-4"), # Debug element
|
| 157 |
dbc.Card([
|
| 158 |
dbc.CardBody([
|
| 159 |
dbc.Input(id="video-url", type="text", placeholder="Enter video URL"),
|
|
|
|
| 185 |
transcript = transcribe_video(url)
|
| 186 |
return transcript
|
| 187 |
except Exception as e:
|
| 188 |
+
logger.exception("Error in transcription:")
|
| 189 |
+
return f"An error occurred: {str(e)}"
|
| 190 |
|
| 191 |
# Run transcription in a separate thread
|
| 192 |
thread = threading.Thread(target=transcribe)
|
|
|
|
| 222 |
return dict(content=transcript, filename="transcript.txt")
|
| 223 |
|
| 224 |
if __name__ == '__main__':
|
| 225 |
+
logger.info("Starting the Dash application...")
|
| 226 |
app.run(debug=True, host='0.0.0.0', port=7860)
|
| 227 |
+
logger.info("Dash application has finished running.")
|