Update app.py
Browse files11 unmodified lines121314151617130 unmodified lines14814915015115215325 unmodified lines17918018118218318418518629 unmodified lines21621721821922022111 unmodified linesfrom dash.exceptions import PreventUpdateimport threadingfrom pytube import YouTubeprint("Script started")130 unmodified linesdbc.Row([dbc.Col([html.H1("Video Transcription with Speaker Separation", className="text-center mb-4"),dbc.Card([dbc.CardBody([dbc.Input(id="video-url", type="text", placeholder="Enter video URL"),25 unmodified linestranscript = transcribe_video(url)return transcriptexcept Exception as e:import tracebackreturn f"An error occurred: {str(e)}\n\nTraceback:\n{traceback.format_exc()}"# Run transcription in a separate threadthread = threading.Thread(target=transcribe)29 unmodified linesreturn dict(content=transcript, filename="transcript.txt")if __name__ == '__main__':print("Starting the Dash application...")app.run(debug=True, host='0.0.0.0', port=7860)print("Dash application has finished running.")11 unmodified lines1213141516171819202122130 unmodified lines15315415515615715815925 unmodified lines18518618718818919019119229 unmodified lines22222322422522622711 unmodified linesfrom dash.exceptions import PreventUpdateimport threadingfrom pytube import YouTubeimport logging# Set up logginglogging.basicConfig(level=logging.DEBUG)logger = logging.getLogger(__name__)print("Script started")130 unmodified linesdbc.Row([dbc.Col([html.H1("Video Transcription with Speaker Separation", className="text-center mb-4"),html.Div("If you can see this, the app is working!", className="text-center mb-4"), # Debug elementdbc.Card([dbc.CardBody([dbc.Input(id="video-url", type="text", placeholder="Enter video URL"),25 unmodified linestranscript = transcribe_video(url)return transcriptexcept Exception as e:logger.exception("Error in transcription:")return f"An error occurred: {str(e)}"# Run transcription in a separate threadthread = threading.Thread(target=transcribe)29 unmodified linesreturn dict(content=transcript, filename="transcript.txt")if __name__ == '__main__':logger.info("Starting the Dash application...")app.run(debug=True, host='0.0.0.0', port=7860)logger.info("Dash application has finished running.")
app.py+10-4