Files changed (1) hide show
  1. app.py +10 -5
app.py CHANGED
@@ -32,7 +32,7 @@ def save_audio(audio):
32
 
33
  return "temp.wav"
34
 
35
- @spaces.GPU(duration=90)
36
  def diarize_audio(temp_file, num_speakers, min_speakers, max_speakers):
37
  if pipeline is None:
38
  return "Error: Pipeline not initialized"
@@ -107,15 +107,20 @@ with gr.Blocks() as demo:
107
 
108
  Please upload an audio file and adjust the parameters as needed.
109
 
110
- The maximum length of the audio file it can process is around **35-40 minutes**.
111
 
112
  If you find this space helpful, please ❤ it.
113
 
114
  Join my server for support and open source AI discussion: https://discord.gg/osai
115
 
 
 
116
  """)
117
- audio_input = gr.Audio(type="filepath", label="Upload Audio")
118
- num_speakers_input = gr.Number(label="Number of Speakers", value=0)
 
 
 
119
  min_speakers_input = gr.Number(label="Minimum Number of Speakers", value=0)
120
  max_speakers_input = gr.Number(label="Maximum Number of Speakers", value=0)
121
  process_button = gr.Button("Process")
@@ -127,4 +132,4 @@ with gr.Blocks() as demo:
127
  inputs=[audio_input, num_speakers_input, min_speakers_input, max_speakers_input],
128
  outputs=[diarization_output, label_file_link]
129
  )
130
- demo.launch()
 
32
 
33
  return "temp.wav"
34
 
35
+ @spaces.GPU(duration=60 * 2)
36
  def diarize_audio(temp_file, num_speakers, min_speakers, max_speakers):
37
  if pipeline is None:
38
  return "Error: Pipeline not initialized"
 
107
 
108
  Please upload an audio file and adjust the parameters as needed.
109
 
110
+ The maximum length of the audio file that can be processed depends based on the hardware it's running on. If you are on the ZeroGPU HuggingFace Space, it's around **35-40 minutes**.
111
 
112
  If you find this space helpful, please ❤ it.
113
 
114
  Join my server for support and open source AI discussion: https://discord.gg/osai
115
 
116
+ IF YOU LEAVE ALL THE PARAMETERS BELOW TO 0, IT WILL BE ON AUTO MODE, AUTOMATICALLY DETECTING THE SPEAKERS, ELSE USE THE ONES BELOW FOR MORE COSTUMIZATION & BETTER RESULTS
117
+
118
  """)
119
+ audio_input = gr.Audio(type="filepath", label="Upload Audio File")
120
+ num_speakers_input = gr.Number(label="Number of Speakers", info="Use it only if you know the number of speakers in advance, else leave it to 0 and use the parameters below", value=0)
121
+
122
+ gr.Markdown("Use the following parameters only if you don't know the number of speakers, you can set lower and/or upper bounds on the number of speakers, if instead you know it, leave the following parameters to 0 and use the one above")
123
+
124
  min_speakers_input = gr.Number(label="Minimum Number of Speakers", value=0)
125
  max_speakers_input = gr.Number(label="Maximum Number of Speakers", value=0)
126
  process_button = gr.Button("Process")
 
132
  inputs=[audio_input, num_speakers_input, min_speakers_input, max_speakers_input],
133
  outputs=[diarization_output, label_file_link]
134
  )
135
+ demo.launch(share = False)