Add per-shot H3 beat directives
This commit is contained in:
@@ -141,6 +141,51 @@ class DumasH3LongVideosHelperTests(unittest.TestCase):
|
||||
self.assertGreater(action_fn.cache_info().hits, 0)
|
||||
self.assertGreater(estimate_fn.cache_info().hits, 0)
|
||||
|
||||
def test_per_shot_directive_helpers_parse_new_controls(self):
|
||||
beat = (
|
||||
"ref_mode: every shot + handoff ref\n"
|
||||
"ref_noise_aug: 0.87\n"
|
||||
"continuity: keyframe carry\n"
|
||||
"The courier waits under the sign."
|
||||
)
|
||||
|
||||
self.assertEqual(
|
||||
self.module.beat_ref_mode_directive(beat),
|
||||
"every shot + handoff ref",
|
||||
)
|
||||
self.assertEqual(self.module.beat_ref_noise_aug_directive(beat), 0.87)
|
||||
self.assertEqual(
|
||||
self.module.beat_continuity_directive(beat),
|
||||
"keyframe carry",
|
||||
)
|
||||
|
||||
def test_distribute_generations_canonicalizes_per_shot_audio_and_anchor_directives(self):
|
||||
generations = self.module.distribute_generations(
|
||||
"",
|
||||
[
|
||||
"anchor_add: harsh sodium spill, wet asphalt reflections\n"
|
||||
"soundscape: distant traffic hiss, loose sign rattle\n"
|
||||
"music: low pulsing synth tension\n"
|
||||
"continuity: hard cut\n"
|
||||
"ref_mode: every shot\n"
|
||||
"ref_noise_aug: 0.88\n"
|
||||
"A courier waits under the streetlight."
|
||||
],
|
||||
"global rain",
|
||||
"global score",
|
||||
)
|
||||
|
||||
block = generations[0]
|
||||
self.assertIn("harsh sodium spill, wet asphalt reflections", block)
|
||||
self.assertIn("overall_soundscape: distant traffic hiss, loose sign rattle", block)
|
||||
self.assertIn("non_diegetic_music: low pulsing synth tension", block)
|
||||
self.assertNotIn("\nsoundscape:", block)
|
||||
self.assertNotIn("\nmusic:", block)
|
||||
self.assertNotIn("\ncontinuity:", block)
|
||||
self.assertNotIn("\nref_mode:", block)
|
||||
self.assertNotIn("\nref_noise_aug:", block)
|
||||
self.assertNotIn("\nanchor_add:", block)
|
||||
|
||||
def test_has_speech_cache_respects_written_text_filter(self):
|
||||
fn = self.module.has_speech
|
||||
fn.cache_clear()
|
||||
|
||||
Reference in New Issue
Block a user