Claw commited on
Commit ·
992765b
1
Parent(s): 1829dd5
Add initial_prompt to Whisper for domain-specific terms
Browse files
app.py
CHANGED
|
@@ -69,7 +69,8 @@ def transcribe(wav):
|
|
| 69 |
inputs.input_features,
|
| 70 |
language="zh",
|
| 71 |
task="transcribe",
|
| 72 |
-
max_new_tokens=256
|
|
|
|
| 73 |
)
|
| 74 |
text = processor.batch_decode(ids, skip_special_tokens=True)[0].strip()
|
| 75 |
if text:
|
|
|
|
| 69 |
inputs.input_features,
|
| 70 |
language="zh",
|
| 71 |
task="transcribe",
|
| 72 |
+
max_new_tokens=256,
|
| 73 |
+
initial_prompt="无人机 架 大疆 北约 大毛 小前线 杨栋梁"
|
| 74 |
)
|
| 75 |
text = processor.batch_decode(ids, skip_special_tokens=True)[0].strip()
|
| 76 |
if text:
|