qqwjq1981 commited on
Commit
dd9a5ec
·
verified ·
1 Parent(s): bbd65e5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -3
app.py CHANGED
@@ -80,9 +80,9 @@ def translate_text(transcription_json, target_language):
80
  "translated": translated_text,
81
  "end": entry["end"]
82
  })
83
- # Log the components being added to translated_json
84
- logger.debug("Adding to translated_json: start=%s, original=%s, translated=%s, end=%s",
85
- entry["start"], original_text, translated_text, entry["end"])
86
 
87
  # Return the translated timestamps as a JSON string
88
  return json.dumps(translated_json, indent=4)
@@ -94,6 +94,10 @@ def add_transcript_to_video(video_path, translated_json, output_path):
94
  # Create text clips based on timestamps
95
  text_clips = []
96
 
 
 
 
 
97
  for entry in translated_json:
98
  # Ensure `entry` is a dictionary with keys "start", "end", and "translated"
99
  if isinstance(entry, dict) and "translated" in entry:
 
80
  "translated": translated_text,
81
  "end": entry["end"]
82
  })
83
+ # Log the components being added to translated_json
84
+ logger.debug("Adding to translated_json: start=%s, original=%s, translated=%s, end=%s",
85
+ entry["start"], original_text, translated_text, entry["end"])
86
 
87
  # Return the translated timestamps as a JSON string
88
  return json.dumps(translated_json, indent=4)
 
94
  # Create text clips based on timestamps
95
  text_clips = []
96
 
97
+ logger.debug("Full translated_json: %s", translated_json)
98
+ for entry in translated_json:
99
+ logger.debug("Processing entry: %s", entry)
100
+
101
  for entry in translated_json:
102
  # Ensure `entry` is a dictionary with keys "start", "end", and "translated"
103
  if isinstance(entry, dict) and "translated" in entry: