cxeep commited on
Commit
c11b3a5
1 Parent(s): 02253c6

customization

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -17,7 +17,7 @@ from src.utils import slugify, write_srt, write_vtt
17
  from src.vad import VadPeriodicTranscription, VadSileroTranscription
18
 
19
  # Limitations (set to -1 to disable)
20
- DEFAULT_INPUT_AUDIO_MAX_DURATION = 600 # seconds
21
 
22
  # Whether or not to automatically delete all uploaded files, to save disk space
23
  DELETE_UPLOADED_FILES = True
@@ -190,12 +190,12 @@ def createUi(inputAudioMaxDuration, share=False, server_name: str = None):
190
 
191
  demo = gr.Interface(fn=ui.transcribeFile, description=ui_description, article=ui_article, inputs=[
192
  gr.Dropdown(choices=["tiny", "base", "small", "medium", "large"], value="medium", label="Model"),
193
- gr.Dropdown(choices=sorted(LANGUAGES), label="Language"),
194
  gr.Text(label="URL (YouTube, etc.)"),
195
  gr.Audio(source="upload", type="filepath", label="Upload Audio"),
196
  gr.Audio(source="microphone", type="filepath", label="Microphone Input"),
197
- gr.Dropdown(choices=["transcribe", "translate"], label="Task"),
198
- gr.Dropdown(choices=["none", "silero-vad", "silero-vad-skip-gaps", "periodic-vad"], label="VAD"),
199
  gr.Number(label="VAD - Merge Window (s)", precision=0, value=5),
200
  gr.Number(label="VAD - Max Merge Size (s)", precision=0, value=150)
201
  ], outputs=[
@@ -204,7 +204,7 @@ def createUi(inputAudioMaxDuration, share=False, server_name: str = None):
204
  gr.Text(label="Segments")
205
  ])
206
 
207
- demo.launch(share=share, server_name=server_name)
208
 
209
  if __name__ == '__main__':
210
  createUi(DEFAULT_INPUT_AUDIO_MAX_DURATION)
 
17
  from src.vad import VadPeriodicTranscription, VadSileroTranscription
18
 
19
  # Limitations (set to -1 to disable)
20
+ DEFAULT_INPUT_AUDIO_MAX_DURATION = -1 # seconds
21
 
22
  # Whether or not to automatically delete all uploaded files, to save disk space
23
  DELETE_UPLOADED_FILES = True
 
190
 
191
  demo = gr.Interface(fn=ui.transcribeFile, description=ui_description, article=ui_article, inputs=[
192
  gr.Dropdown(choices=["tiny", "base", "small", "medium", "large"], value="medium", label="Model"),
193
+ gr.Dropdown(choices=sorted(LANGUAGES), label="Language", value="Chinese"),
194
  gr.Text(label="URL (YouTube, etc.)"),
195
  gr.Audio(source="upload", type="filepath", label="Upload Audio"),
196
  gr.Audio(source="microphone", type="filepath", label="Microphone Input"),
197
+ gr.Dropdown(choices=["transcribe", "translate"], label="Task", value="transcribe"),
198
+ gr.Dropdown(choices=["none", "silero-vad", "silero-vad-skip-gaps", "periodic-vad"], label="VAD", value="silero-vad"),
199
  gr.Number(label="VAD - Merge Window (s)", precision=0, value=5),
200
  gr.Number(label="VAD - Max Merge Size (s)", precision=0, value=150)
201
  ], outputs=[
 
204
  gr.Text(label="Segments")
205
  ])
206
 
207
+ demo.launch(share=True, server_name='0.0.0.0')
208
 
209
  if __name__ == '__main__':
210
  createUi(DEFAULT_INPUT_AUDIO_MAX_DURATION)