renatotn7 commited on
Commit
2096575
1 Parent(s): 8ce97ae

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -7
app.py CHANGED
@@ -2,6 +2,7 @@ import streamlit as st
2
  import os
3
  os.system("pip install git+https://github.com/openai/whisper.git")
4
  import whisper
 
5
  import ffmpeg
6
  import os
7
  from transformers import pipeline
@@ -72,16 +73,12 @@ if st.button('Processa'):
72
 
73
  #transcription = processor.batch_decode(predicted_ids, skip_special_tokens = True)
74
  string1=''
75
- # for i, segment in enumerate(transcription, start=1):
76
  # write srt lines
77
- # string1=string1+'\n' +
78
- # f"{i}\n"+
79
- # f"{format_timestamp(segment['start'], always_include_hours=True, decimal_marker=',')} --> "+
80
- # f"{format_timestamp(segment['end'], always_include_hours=True, decimal_marker=',')}\n"+
81
- # f"{segment['text'].strip().replace('-->', '->')}\n";
82
 
83
 
84
- st.json(transcription )
85
  st.success("Texto Gerado")
86
  # print('3')
87
 
 
2
  import os
3
  os.system("pip install git+https://github.com/openai/whisper.git")
4
  import whisper
5
+ from whisper import utils
6
  import ffmpeg
7
  import os
8
  from transformers import pipeline
 
73
 
74
  #transcription = processor.batch_decode(predicted_ids, skip_special_tokens = True)
75
  string1=''
76
+ for i, segment in enumerate(transcription, start=1):
77
  # write srt lines
78
+ string1=string1+"\n" + f"{i}\n"+ f"{utils.format_timestamp(segment['start'], always_include_hours=True, decimal_marker=',')} --> " + f"{utils.format_timestamp(segment['end'], always_include_hours=True, decimal_marker=',')}\n"+ f"{segment['text'].strip().replace('-->', '->')}\n";
 
 
 
 
79
 
80
 
81
+ st.write(string1 )
82
  st.success("Texto Gerado")
83
  # print('3')
84