jlonsako commited on
Commit
1db1226
1 Parent(s): 35ca684

Trying to fix file downloading

Browse files
Files changed (1) hide show
  1. app.py +3 -4
app.py CHANGED
@@ -27,7 +27,6 @@ def preprocessAudio(audioFile):
27
  os.system(f"ffmpeg -y -i {audioFile.name} -ar 16000 ./audio.wav")
28
 
29
  #Transcribe!!!
30
-
31
  def Transcribe(file):
32
  device = "cuda:0" if torch.cuda.is_available() else "cpu"
33
  start_time = time.time()
@@ -35,7 +34,7 @@ def Transcribe(file):
35
 
36
  preprocessAudio(file)
37
  #os.system(f"ffmpeg -y -i ./July3_2023_Sermon.mov -ar 16000 ./audio.wav")
38
- block_size = 30
39
 
40
  transcripts = []
41
  stream = librosa.stream(
@@ -90,9 +89,9 @@ def Transcribe(file):
90
  end_time = time.time()
91
  os.system("rm ./audio.wav")
92
  print(f"The script ran for {end_time - start_time} seconds.")
93
- return("subtitle.sbv")
94
 
95
- demo = gr.Interface(fn=Transcribe, inputs=gr.File(), outputs=gr.File())
96
  #with gr.Blocks() as demo:
97
  #file_output = gr.Textbox()
98
  #upload_button = gr.UploadButton("Click to Upload a sermon",
 
27
  os.system(f"ffmpeg -y -i {audioFile.name} -ar 16000 ./audio.wav")
28
 
29
  #Transcribe!!!
 
30
  def Transcribe(file):
31
  device = "cuda:0" if torch.cuda.is_available() else "cpu"
32
  start_time = time.time()
 
34
 
35
  preprocessAudio(file)
36
  #os.system(f"ffmpeg -y -i ./July3_2023_Sermon.mov -ar 16000 ./audio.wav")
37
+ block_size = 30 #30 second chunks of audio
38
 
39
  transcripts = []
40
  stream = librosa.stream(
 
89
  end_time = time.time()
90
  os.system("rm ./audio.wav")
91
  print(f"The script ran for {end_time - start_time} seconds.")
92
+ return("./subtitle.sbv")
93
 
94
+ demo = gr.Interface(fn=Transcribe, inputs=gr.File(), "file")
95
  #with gr.Blocks() as demo:
96
  #file_output = gr.Textbox()
97
  #upload_button = gr.UploadButton("Click to Upload a sermon",