Repeat shared context in every chunk
This commit is contained in:
+7
-5
@@ -106,22 +106,24 @@ def format_sequence_prompt(
|
||||
``start-end s:`` lines rather than creating additional Timeline sections.
|
||||
"""
|
||||
|
||||
sections: list[str] = []
|
||||
directive = str(shared_directive or "").strip()
|
||||
if directive:
|
||||
sections.append(directive)
|
||||
sound = str(soundscape or "").strip() or "N/A"
|
||||
music_text = str(music or "").strip() or "N/A"
|
||||
sections: list[str] = []
|
||||
cursor = 0.0
|
||||
for clip in sequence["clips"]:
|
||||
duration = float(clip["duration"])
|
||||
chunk_lines = [f"[{cursor:g}-{cursor + duration:g}s]"]
|
||||
if directive:
|
||||
chunk_lines.append(directive)
|
||||
for slot in clip["slots"]:
|
||||
start = float(slot["start"])
|
||||
end = float(slot["end"])
|
||||
chunk_lines.append(f"{start:g}-{end:g}s: {slot['text']}")
|
||||
chunk_lines.append(f"overall_soundscape: {sound}")
|
||||
chunk_lines.append(f"non_diegetic_music: {music_text}")
|
||||
sections.append("\n".join(chunk_lines))
|
||||
cursor += duration
|
||||
sections.append(f"overall_soundscape: {str(soundscape or '').strip() or 'N/A'}")
|
||||
sections.append(f"non_diegetic_music: {str(music or '').strip() or 'N/A'}")
|
||||
return "\n\n".join(sections).strip()
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user