Spaces:
Running
Running
jhj0517
commited on
Commit
·
6f97cc2
1
Parent(s):
b028014
add `whisper_type` arg
Browse files
app.py
CHANGED
|
@@ -24,10 +24,13 @@ class App:
|
|
| 24 |
def init_whisper(self):
|
| 25 |
whisper_type = self.args.whisper_type.lower().strip()
|
| 26 |
|
| 27 |
-
if whisper_type in ["faster_whisper", "faster-whisper"]:
|
| 28 |
whisper_inf = FasterWhisperInference()
|
| 29 |
whisper_inf.model_dir = self.args.faster_whisper_model_dir
|
| 30 |
-
|
|
|
|
|
|
|
|
|
|
| 31 |
whisper_inf = WhisperInference()
|
| 32 |
whisper_inf.model_dir = self.args.whisper_model_dir
|
| 33 |
else:
|
|
@@ -351,6 +354,7 @@ parser.add_argument('--colab', type=bool, default=False, nargs='?', const=True,
|
|
| 351 |
parser.add_argument('--api_open', type=bool, default=False, nargs='?', const=True, help='enable api or not')
|
| 352 |
parser.add_argument('--whisper_model_dir', type=str, default=os.path.join("models", "Whisper"), help='Directory path of the whisper model')
|
| 353 |
parser.add_argument('--faster_whisper_model_dir', type=str, default=os.path.join("models", "Whisper", "faster-whisper"), help='Directory path of the faster-whisper model')
|
|
|
|
| 354 |
_args = parser.parse_args()
|
| 355 |
|
| 356 |
if __name__ == "__main__":
|
|
|
|
| 24 |
def init_whisper(self):
|
| 25 |
whisper_type = self.args.whisper_type.lower().strip()
|
| 26 |
|
| 27 |
+
if whisper_type in ["faster_whisper", "faster-whisper", "fasterwhisper"]:
|
| 28 |
whisper_inf = FasterWhisperInference()
|
| 29 |
whisper_inf.model_dir = self.args.faster_whisper_model_dir
|
| 30 |
+
elif whisper_type in ["whisper"]:
|
| 31 |
+
whisper_inf = WhisperInference()
|
| 32 |
+
whisper_inf.model_dir = self.args.whisper_model_dir
|
| 33 |
+
elif whisper_type in ["insanely_whisper", "insanely-whisper", "insanelywhisper"]:
|
| 34 |
whisper_inf = WhisperInference()
|
| 35 |
whisper_inf.model_dir = self.args.whisper_model_dir
|
| 36 |
else:
|
|
|
|
| 354 |
parser.add_argument('--api_open', type=bool, default=False, nargs='?', const=True, help='enable api or not')
|
| 355 |
parser.add_argument('--whisper_model_dir', type=str, default=os.path.join("models", "Whisper"), help='Directory path of the whisper model')
|
| 356 |
parser.add_argument('--faster_whisper_model_dir', type=str, default=os.path.join("models", "Whisper", "faster-whisper"), help='Directory path of the faster-whisper model')
|
| 357 |
+
parser.add_argument('--insanely_fast_whisper_model_dir', type=str, default=os.path.join("models", "Whisper", "insanely-fast-whisper"), help='Directory path of the insanely-fast-whisper model')
|
| 358 |
_args = parser.parse_args()
|
| 359 |
|
| 360 |
if __name__ == "__main__":
|