Spaces:
Running
Running
Use correct pipeline configs
Browse files
app.py
CHANGED
@@ -8,22 +8,22 @@ from huggingface_hub import model_info
|
|
8 |
#MODEL_NAME = "ihanif/whisper-medium-ps-augmented" #this always needs to stay in line 8 :D sorry for the hackiness
|
9 |
# MODEL_NAME = "ihanif/whisper-turbo-ar"
|
10 |
MODEL_NAME = "ihanif/whisper-base-cv20-v1" #"ihanif/whisper-small-tunning-v2"
|
11 |
-
lang = "
|
12 |
task="transcribe"
|
13 |
|
14 |
device = 0 if torch.cuda.is_available() else "cpu"
|
15 |
pipe = pipeline(
|
16 |
task="automatic-speech-recognition",
|
17 |
model=MODEL_NAME,
|
18 |
-
chunk_length_s=30,
|
19 |
device=device,
|
20 |
)
|
21 |
|
22 |
# pipe.model.config.forced_decoder_ids = pipe.tokenizer.get_decoder_prompt_ids(language=lang, task=task)
|
23 |
|
24 |
-
pipe.model.generation_config.language = lang
|
25 |
-
pipe.model.generation_config.task = task
|
26 |
-
pipe.model.generation_config.forced_decoder_ids = None
|
27 |
|
28 |
def transcribe(microphone, file_upload):
|
29 |
warn_output = ""
|
|
|
8 |
#MODEL_NAME = "ihanif/whisper-medium-ps-augmented" #this always needs to stay in line 8 :D sorry for the hackiness
|
9 |
# MODEL_NAME = "ihanif/whisper-turbo-ar"
|
10 |
MODEL_NAME = "ihanif/whisper-base-cv20-v1" #"ihanif/whisper-small-tunning-v2"
|
11 |
+
lang = "ps"
|
12 |
task="transcribe"
|
13 |
|
14 |
device = 0 if torch.cuda.is_available() else "cpu"
|
15 |
pipe = pipeline(
|
16 |
task="automatic-speech-recognition",
|
17 |
model=MODEL_NAME,
|
18 |
+
# chunk_length_s=30,
|
19 |
device=device,
|
20 |
)
|
21 |
|
22 |
# pipe.model.config.forced_decoder_ids = pipe.tokenizer.get_decoder_prompt_ids(language=lang, task=task)
|
23 |
|
24 |
+
# pipe.model.generation_config.language = lang
|
25 |
+
# pipe.model.generation_config.task = task
|
26 |
+
# pipe.model.generation_config.forced_decoder_ids = None
|
27 |
|
28 |
def transcribe(microphone, file_upload):
|
29 |
warn_output = ""
|