Athspi commited on
Commit
9807843
·
verified ·
1 Parent(s): a2554b6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -4
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. NO timestamps or speaker labels.
43
- 3. Add performance cues (e.g., [laugh], [sigh]) and directions (e.g., "Say happily:").
 
 
 
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-1.5-pro-latest")
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