denizaybey commited on
Commit
7b41181
·
1 Parent(s): 11a75a9

Add TODO comments and update UI text in `app.py`

Browse files

- Marked areas requiring updates with TODO comments for endpoints, payloads, and upload accuracy.
- Revised app title and description to align with branding.

Files changed (1) hide show
  1. app.py +7 -7
app.py CHANGED
@@ -29,11 +29,11 @@ def process_audio(original_audio_path, dubbed_audio_path, email, company_name, t
29
 
30
  # --- ACTION REQUIRED ---
31
  # Please replace the following placeholder URLs with your actual API endpoints.
32
- presigned_url_endpoint = "https://your-api.com/get-presigned-urls"
33
- processing_endpoint = "https://your-api.com/trigger-processing"
34
  # --------------------------
35
 
36
- # 2.1. Get presigned URLs from your endpoint.
37
  payload = {
38
  "files": [
39
  {"name": os.path.basename(original_audio_path), "type": "audio/wav"},
@@ -58,7 +58,7 @@ def process_audio(original_audio_path, dubbed_audio_path, email, company_name, t
58
  except KeyError:
59
  return "Error: Could not parse the presigned URL response. Please check the JSON structure."
60
 
61
- # 2.2. Upload the audio files to the presigned URLs.
62
  try:
63
  print(f"Uploading original file to: {original_upload_url}")
64
  with open(original_audio_path, 'rb') as f:
@@ -74,7 +74,7 @@ def process_audio(original_audio_path, dubbed_audio_path, email, company_name, t
74
  return f"Error uploading files: {e}"
75
 
76
  # 3. Call the endpoint to trigger the processing.
77
- processing_payload = {
78
  "email": email,
79
  "company_name": company_name,
80
  "tolerance": tolerance,
@@ -104,8 +104,8 @@ demo = gr.Interface(
104
  gr.Slider(0, 100, value=5, label="Tolerance Percentage", info="Set the tolerance for audio comparison.")
105
  ],
106
  outputs=gr.Text(label="Processing Status"),
107
- title="Audio Dubbing Verification",
108
- description="Upload original and dubbed .wav files (under 30 minutes) to start the verification process.",
109
  allow_flagging="never"
110
  )
111
 
 
29
 
30
  # --- ACTION REQUIRED ---
31
  # Please replace the following placeholder URLs with your actual API endpoints.
32
+ presigned_url_endpoint = "https://your-api.com/get-presigned-urls" # TODO: Change URL
33
+ processing_endpoint = "https://your-api.com/trigger-processing" # TODO: Change URL
34
  # --------------------------
35
 
36
+ # 2.1. Get presigned URLs from your endpoint. # TODO: Change Payload
37
  payload = {
38
  "files": [
39
  {"name": os.path.basename(original_audio_path), "type": "audio/wav"},
 
58
  except KeyError:
59
  return "Error: Could not parse the presigned URL response. Please check the JSON structure."
60
 
61
+ # 2.2. Upload the audio files to the presigned URLs. # TODO: Check for PUT accuracy
62
  try:
63
  print(f"Uploading original file to: {original_upload_url}")
64
  with open(original_audio_path, 'rb') as f:
 
74
  return f"Error uploading files: {e}"
75
 
76
  # 3. Call the endpoint to trigger the processing.
77
+ processing_payload = { # TODO: Change Payload
78
  "email": email,
79
  "company_name": company_name,
80
  "tolerance": tolerance,
 
104
  gr.Slider(0, 100, value=5, label="Tolerance Percentage", info="Set the tolerance for audio comparison.")
105
  ],
106
  outputs=gr.Text(label="Processing Status"),
107
+ title="BSOD.tv - Dub QC Demo",
108
+ description="Upload original and dubbed .wav files (under 30 minutes) to start the QC process.",
109
  allow_flagging="never"
110
  )
111