bichnhan2701 commited on
Commit
be6b69c
·
1 Parent(s): c816b75

Update transcribe job

Browse files
Files changed (1) hide show
  1. app/jobs/transcribe_job.py +7 -2
app/jobs/transcribe_job.py CHANGED
@@ -32,8 +32,13 @@ def transcribe_job(audio_url: str, note_id: str, user_id: str | None = None):
32
  chunks = transcribe_file_chunks(model, wav_path, 30.0, 5.0)
33
 
34
  chunks = [
35
- c for c in chunks
36
- if c.get("text", "").strip() and c.get("end", 0) > c.get("start", 0)
 
 
 
 
 
37
  ]
38
 
39
  note_status = "transcribed" if chunks else "error"
 
32
  chunks = transcribe_file_chunks(model, wav_path, 30.0, 5.0)
33
 
34
  chunks = [
35
+ {
36
+ "text": c["text"],
37
+ "start": c.get("start"),
38
+ "end": c.get("end"),
39
+ }
40
+ for c in chunks
41
+ if c.get("text", "").strip()
42
  ]
43
 
44
  note_status = "transcribed" if chunks else "error"