Spaces:
Runtime error
Runtime error
Merge branch 'modal-integration-fix' into 'main'
Browse filesFix audio file naming and update dependency version
See merge request sonne-technology/bsod-tv/waveform-matching-gradio-front-end!14
Files changed (2)
- app.py+7-6
- requirements.txt+2-2
18 unmodified lines19202122232420 unmodified lines45464748495051226 unmodified lines27827928028128228328428528628728828929029113 unmodified lines30530630730830931031118 unmodified linesfile upload to presigned URLs, and triggering the processing."""# 1. Check the duration of both audio files.modal_token_id = os.environ['MODAL_TOKEN_ID']modal_token_secret = os.environ['MODAL_TOKEN_SECRET']modal_environment = os.environ['MODAL_ENVIRONMENT']20 unmodified linesbsodtv_storage = modal.Volume.from_name(modal_volume)with bsodtv_storage.batch_upload() as batch:batch.put_file(original_audio_path, "/{}/original_audio.wav".format(processing_id))batch.put_file(dubbed_audio_path, "/{}/original_audio.wav".format(processing_id))bsodtv_storage.commit()except:return "Error uploading audio files to Cloud Storage."226 unmodified lines# Second Row: 2/3 Email Input 1/3 Company Name Inputwith gr.Row(elem_classes="input-section"):with gr.Column(scale=2):email = gr.Textbox(label="Email")with gr.Column(scale=1):company_name = gr.Textbox(label="Company Name")# Third Row: Tolerance Percentagewith gr.Row(elem_classes="input-section"):tolerance = gr.Slider(0, 100, value=5, label="Tolerance Percentage",info="Set the tolerance for audio comparison.")# Fourth Row: Processing Statuswith gr.Row(elem_classes="output-section"):13 unmodified lines# Set up the processing functionsubmit_btn.click(fn=process_audio,inputs=[original_audio, dubbed_audio, email, company_name, tolerance],outputs=output)18 unmodified lines1920212223242520 unmodified lines46474849505152226 unmodified lines27928028128228328428528628728828929029129213 unmodified lines30630730830931031131218 unmodified linesfile upload to presigned URLs, and triggering the processing."""# 1. Check the duration of both audio files.app = modal.App("Waveform-Matching")modal_token_id = os.environ['MODAL_TOKEN_ID']modal_token_secret = os.environ['MODAL_TOKEN_SECRET']modal_environment = os.environ['MODAL_ENVIRONMENT']20 unmodified linesbsodtv_storage = modal.Volume.from_name(modal_volume)with bsodtv_storage.batch_upload() as batch:batch.put_file(original_audio_path, "/{}/original_audio.wav".format(processing_id))batch.put_file(dubbed_audio_path, "/{}/dubbed_audio.wav".format(processing_id))bsodtv_storage.commit()except:return "Error uploading audio files to Cloud Storage."226 unmodified lines# Second Row: 2/3 Email Input 1/3 Company Name Inputwith gr.Row(elem_classes="input-section"):with gr.Column(scale=2):_email = gr.Textbox(label="Email")with gr.Column(scale=1):_company_name = gr.Textbox(label="Company Name")# Third Row: Tolerance Percentagewith gr.Row(elem_classes="input-section"):_tolerance = gr.Slider(0, 100, value=5, label="Tolerance Percentage",info="Set the tolerance for audio comparison.")# Fourth Row: Processing Statuswith gr.Row(elem_classes="output-section"):13 unmodified lines# Set up the processing functionsubmit_btn.click(fn=process_audio,inputs=[original_audio, dubbed_audio, _email, _company_name, _tolerance],outputs=output)
12modalgradio12modal==1.0.4gradio
app.py+7-6
requirements.txt+2-2