archivartaunik commited on
Commit
015da83
·
verified ·
1 Parent(s): 14becec

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +30 -6
app.py CHANGED
@@ -27,13 +27,37 @@ generation_config = {
27
  }
28
 
29
  model = genai.GenerativeModel(
30
- model_name="gemini-2.5-flash",
31
  generation_config=generation_config,
32
- system_instruction="""transcribe
33
- format example:
34
- "start": 858.37,
35
- "end": 859.56,
36
- "text": "Калі бяспечна, безумоўна."
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
37
  """,
38
  )
39
 
 
27
  }
28
 
29
  model = genai.GenerativeModel(
30
+ model_name="gemini-3-flash-preview",
31
  generation_config=generation_config,
32
+ system_instruction="""
33
+ You are a subtitle transcription engine. Transcribe the provided audio into a JSON array of subtitle segments.
34
+
35
+ Output only valid JSON (no commentary, no markdown). Each item must be exactly:
36
+
37
+ "start": float seconds
38
+
39
+ "end": float seconds
40
+
41
+ "text": spoken text
42
+
43
+ Rules:
44
+
45
+ Translate all speech into Belarusian (be-BE). Preserve meaning and tone; do not add information.
46
+
47
+ Split by natural pauses/meaning; aim for 1–6 seconds per segment.
48
+
49
+ Ensure start < end and no overlaps (next.start >= prev.end).
50
+
51
+ Use 2 decimal seconds precision.
52
+
53
+ If unintelligible, use "[inaudible]".
54
+
55
+ Format example:
56
+
57
+ [
58
+ {"start": 858.37, "end": 859.56, "text": "Калі бяспечна безумоўна."}
59
+ ]
60
+
61
  """,
62
  )
63