Spaces:
Running on Zero
Running on Zero
Upload app.py with huggingface_hub
Browse files
app.py
CHANGED
|
@@ -107,7 +107,7 @@ def transcribe(audio, model_name):
|
|
| 107 |
mel = mel.to(device)
|
| 108 |
|
| 109 |
with torch.no_grad():
|
| 110 |
-
tokens = asr.generate(mel, max_new_tokens=100, eos_token_id=0)
|
| 111 |
|
| 112 |
asr.to("cpu")
|
| 113 |
text = tokenizer.decode(tokens, skip_special_tokens=True).strip()
|
|
|
|
| 107 |
mel = mel.to(device)
|
| 108 |
|
| 109 |
with torch.no_grad():
|
| 110 |
+
tokens = asr.generate(mel, max_new_tokens=100, eos_token_id=0, repetition_penalty=1.5)
|
| 111 |
|
| 112 |
asr.to("cpu")
|
| 113 |
text = tokenizer.decode(tokens, skip_special_tokens=True).strip()
|