Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -156,7 +156,16 @@ def recognize_speech(audio_path):
|
|
156 |
inputs = {k: v.to(device) for k, v in inputs.items()}
|
157 |
|
158 |
# Generate transcription
|
159 |
-
generated_ids = speech_recognizer.generate(**inputs)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
160 |
transcription = speech_processor.batch_decode(generated_ids, skip_special_tokens=True)[0]
|
161 |
|
162 |
return transcription
|
|
|
156 |
inputs = {k: v.to(device) for k, v in inputs.items()}
|
157 |
|
158 |
# Generate transcription
|
159 |
+
#generated_ids = speech_recognizer.generate(**inputs)
|
160 |
+
generated_ids = speech_recognizer.generate(
|
161 |
+
**inputs,
|
162 |
+
max_length=100,
|
163 |
+
num_beams=3, # Reduced from default
|
164 |
+
early_stopping=False, # Disabled
|
165 |
+
no_repeat_ngram_size=3,
|
166 |
+
temperature=0.7, # Added for stability
|
167 |
+
do_sample=False # Disable sampling
|
168 |
+
)
|
169 |
transcription = speech_processor.batch_decode(generated_ids, skip_special_tokens=True)[0]
|
170 |
|
171 |
return transcription
|