Spaces:
Running on Zero
Running on Zero
Remove stale prompt_template.py from a previous build
Browse files- prompt_template.py +0 -40
prompt_template.py
DELETED
|
@@ -1,40 +0,0 @@
|
|
| 1 |
-
"""Prompt template shared by MiniMax-H3 T2VA prompt-rewriter inference."""
|
| 2 |
-
|
| 3 |
-
from __future__ import annotations
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
SYSTEM_PROMPT = """You are a professional prompt rewriter for joint audio-video generation.
|
| 7 |
-
Rewrite the user's original prompt into one coherent, production-ready multimodal description for the requested output aspect ratio and duration.
|
| 8 |
-
|
| 9 |
-
Return only these three fields, in this exact order:
|
| 10 |
-
integrated_multimodal_description: ...
|
| 11 |
-
overall_soundscape: ...
|
| 12 |
-
non_diegetic_music: ...
|
| 13 |
-
|
| 14 |
-
Requirements:
|
| 15 |
-
- Expand the visual narrative into clearly numbered shots such as [Shot 1], [Shot 2], and include timestamps for cuts after the first shot when useful.
|
| 16 |
-
- Make the number, timing, and pacing of shots appropriate for the requested duration.
|
| 17 |
-
- Compose the scene for the requested aspect ratio.
|
| 18 |
-
- Preserve the user's intent while adding concrete subjects, appearance, environment, lighting, composition, camera movement, physical motion, and temporal continuity.
|
| 19 |
-
- Keep characters, objects, wardrobe, locations, and spatial relationships consistent across shots.
|
| 20 |
-
- Describe synchronized diegetic audio in overall_soundscape and external score in non_diegetic_music.
|
| 21 |
-
- Do not add explanations, Markdown fences, safety commentary, or fields other than the three requested fields."""
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
def build_messages(prompt: str, resolution: str, duration: int) -> list[dict[str, str]]:
|
| 25 |
-
"""Build the chat messages used during LoRA training and inference."""
|
| 26 |
-
prompt = prompt.strip()
|
| 27 |
-
if not prompt:
|
| 28 |
-
raise ValueError("prompt must not be empty")
|
| 29 |
-
|
| 30 |
-
return [
|
| 31 |
-
{"role": "system", "content": SYSTEM_PROMPT},
|
| 32 |
-
{
|
| 33 |
-
"role": "user",
|
| 34 |
-
"content": (
|
| 35 |
-
f"resolution: {resolution}\n"
|
| 36 |
-
f"duration: {duration}s\n"
|
| 37 |
-
f"original_prompt: {prompt}"
|
| 38 |
-
),
|
| 39 |
-
},
|
| 40 |
-
]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|