Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -15,6 +15,7 @@ else:
|
|
15 |
torch_dtype = torch.float32
|
16 |
|
17 |
pipe = pipeline(task="automatic-speech-recognition", model=model_repo_id, device=device)
|
|
|
18 |
|
19 |
# @spaces.GPU #[uncomment to use ZeroGPU]
|
20 |
def infer(
|
@@ -25,7 +26,7 @@ def infer(
|
|
25 |
wav = wav.mean(axis=1)
|
26 |
wav = wav.astype(np.float32)
|
27 |
wav /= np.max(np.abs(wav))
|
28 |
-
return pipe(wav
|
29 |
|
30 |
css = """
|
31 |
#col-container {
|
|
|
15 |
torch_dtype = torch.float32
|
16 |
|
17 |
pipe = pipeline(task="automatic-speech-recognition", model=model_repo_id, device=device)
|
18 |
+
pipe.model.generation_config.forced_decoder_ids = pipe.processor.get_decoder_prompt_ids(language="zh", task="transcribe")
|
19 |
|
20 |
# @spaces.GPU #[uncomment to use ZeroGPU]
|
21 |
def infer(
|
|
|
26 |
wav = wav.mean(axis=1)
|
27 |
wav = wav.astype(np.float32)
|
28 |
wav /= np.max(np.abs(wav))
|
29 |
+
return pipe(wav)['text']
|
30 |
|
31 |
css = """
|
32 |
#col-container {
|