aadnk commited on
Commit
de7a3ac
1 Parent(s): 02edf9e

Add support for sharing

Browse files
Files changed (2) hide show
  1. app-shared.py +3 -0
  2. app.py +2 -3
app-shared.py ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ # Run the app with no audio file restrictions
2
+ from app import createUi
3
+ createUi(-1, share=True)
app.py CHANGED
@@ -65,7 +65,7 @@ class UI:
65
  return result["text"], segmentStream.read()
66
 
67
 
68
- def createUi(inputAudioMaxDuration):
69
  ui = UI(inputAudioMaxDuration)
70
 
71
  ui_description = "Whisper is a general-purpose speech recognition model. It is trained on a large dataset of diverse "
@@ -83,8 +83,7 @@ def createUi(inputAudioMaxDuration):
83
  gr.Dropdown(choices=["transcribe", "translate"], label="Task"),
84
  ], outputs=[gr.Text(label="Transcription"), gr.Text(label="Segments")])
85
 
86
-
87
- demo.launch()
88
 
89
  if __name__ == '__main__':
90
  createUi(DEFAULT_INPUT_AUDIO_MAX_DURATION)
 
65
  return result["text"], segmentStream.read()
66
 
67
 
68
+ def createUi(inputAudioMaxDuration, share=False):
69
  ui = UI(inputAudioMaxDuration)
70
 
71
  ui_description = "Whisper is a general-purpose speech recognition model. It is trained on a large dataset of diverse "
 
83
  gr.Dropdown(choices=["transcribe", "translate"], label="Task"),
84
  ], outputs=[gr.Text(label="Transcription"), gr.Text(label="Segments")])
85
 
86
+ demo.launch(share=share)
 
87
 
88
  if __name__ == '__main__':
89
  createUi(DEFAULT_INPUT_AUDIO_MAX_DURATION)