habulaj commited on
Commit
8c42e32
·
verified ·
1 Parent(s): 7016c94

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -3
app.py CHANGED
@@ -863,7 +863,7 @@ async def generate_subtitle(
863
  if context:
864
  context_instruction = f"\n6. **USER INSTRUCTIONS**: {context}\n"
865
 
866
- prompt = f"""Task: Translate and Correct the SRT subtitles to Brazilian Portuguese (PT-BR).
867
 
868
  SOURCE MATERIAL: I have attached the video/audio file. Use it as the PRIMARY source of truth for context, speaker identification, and meaning.
869
  INPUT SRT: I have provided a draft SRT generated by an automated transcription service.
@@ -871,8 +871,14 @@ INPUT SRT: I have provided a draft SRT generated by an automated transcription s
871
  CRITICAL INSTRUCTIONS:
872
  1. **CORRECTION**: The input SRT is a draft. It may have wrong words or misinterpretations. **You MUST correct the text based on the actual audio.**
873
  2. **TIMESTAMPS**: The timestamps in the input SRT are generally correct. **Keep them as much as possible**, only adjust if they are clearly wrong / desynchronized.
874
- 3. **FORMATTING**: Do NOT change the line breaks or the number of lines. The visual structure (2 lines max, balanced) is already optimized.
875
- 4. **CONTEXT**: Translate naturally for a Brazilian audience.
 
 
 
 
 
 
876
  5. **PUNCTUATION**: Adjust punctuation to fit the context best.
877
  6. **OUTPUT**: Return ONLY the corrected and translated SRT content. No extra text.{context_instruction}
878
 
 
863
  if context:
864
  context_instruction = f"\n6. **USER INSTRUCTIONS**: {context}\n"
865
 
866
+ prompt = f"""Translate and Correct the SRT subtitles to Brazilian Portuguese (PT-BR).
867
 
868
  SOURCE MATERIAL: I have attached the video/audio file. Use it as the PRIMARY source of truth for context, speaker identification, and meaning.
869
  INPUT SRT: I have provided a draft SRT generated by an automated transcription service.
 
871
  CRITICAL INSTRUCTIONS:
872
  1. **CORRECTION**: The input SRT is a draft. It may have wrong words or misinterpretations. **You MUST correct the text based on the actual audio.**
873
  2. **TIMESTAMPS**: The timestamps in the input SRT are generally correct. **Keep them as much as possible**, only adjust if they are clearly wrong / desynchronized.
874
+ 3. **FORMATTING**:
875
+ - Keep the visual structure (2 lines max).
876
+ - **DIALOGUES**: If two different people speak in the same block, separate them with a hyphen "- " at the start of each line.
877
+ * Example Input: "I did it. So did I."
878
+ * Example Output:
879
+ - Eu fiz isso.
880
+ - Eu também.
881
+ 4. **CONTEXT**: Translate naturally for a Brazilian audience. Prioritize clarity and meaning over literal translation. Make it readable and elegant.
882
  5. **PUNCTUATION**: Adjust punctuation to fit the context best.
883
  6. **OUTPUT**: Return ONLY the corrected and translated SRT content. No extra text.{context_instruction}
884