Update app.py
Browse files
app.py
CHANGED
@@ -38,9 +38,12 @@ GEMINI_PROMPT = """
|
|
38 |
You are an expert AI scriptwriter. Your task is to watch the provided video and transcribe ALL spoken dialogue into a SINGLE, CONTINUOUS block of modern, colloquial Tamil.
|
39 |
|
40 |
**CRITICAL INSTRUCTIONS:**
|
41 |
-
1. Combine all dialogue into one continuous script.
|
42 |
-
2.
|
43 |
-
3. Add performance
|
|
|
|
|
|
|
44 |
"""
|
45 |
|
46 |
@app.post("/process")
|
@@ -92,7 +95,7 @@ async def generate_script(video_path: str) -> str:
|
|
92 |
if video_file.state.name != "ACTIVE":
|
93 |
raise Exception("Gemini processing failed")
|
94 |
|
95 |
-
model = genai.GenerativeModel("models/gemini-
|
96 |
response = model.generate_content([GEMINI_PROMPT, video_file])
|
97 |
genai.delete_file(video_file.name)
|
98 |
|
|
|
38 |
You are an expert AI scriptwriter. Your task is to watch the provided video and transcribe ALL spoken dialogue into a SINGLE, CONTINUOUS block of modern, colloquial Tamil.
|
39 |
|
40 |
**CRITICAL INSTRUCTIONS:**
|
41 |
+
1. **Single Script:** Combine all dialogue from all speakers into one continuous script.
|
42 |
+
2. **NO Timestamps or Speaker Labels:** Do NOT include any timestamps or speaker identifiers.
|
43 |
+
3. **Incorporate Performance:** Add English style prompts (e.g., `Say happily:`, `Whisper mysteriously:`) and performance tags (e.g., `[laugh]`, `[sigh]`) directly into the text for an expressive narration.
|
44 |
+
|
45 |
+
**EXAMPLE OUTPUT:**
|
46 |
+
Say happily: வணக்கம்! [laugh] எப்படி இருக்கீங்க? Whisper mysteriously: அந்த ரகசியம் எனக்கு மட்டும் தான் தெரியும்.
|
47 |
"""
|
48 |
|
49 |
@app.post("/process")
|
|
|
95 |
if video_file.state.name != "ACTIVE":
|
96 |
raise Exception("Gemini processing failed")
|
97 |
|
98 |
+
model = genai.GenerativeModel("models/gemini-2.5-flash")
|
99 |
response = model.generate_content([GEMINI_PROMPT, video_file])
|
100 |
genai.delete_file(video_file.name)
|
101 |
|