Spaces:
Running
Running
add hotwords_file_path
Browse files- app/asr_worker.py +4 -3
app/asr_worker.py
CHANGED
@@ -215,9 +215,10 @@ def create_recognizer(
|
|
215 |
clean = w.replace("\\", "").replace("<unk>", "").strip()
|
216 |
if clean: # only write non-empty lines
|
217 |
tf.write(f"{clean}\n")
|
218 |
-
|
219 |
-
|
220 |
-
|
|
|
221 |
|
222 |
# Create beam-search recognizer with biasing :contentReference[oaicite:0]{index=0}
|
223 |
return sherpa_onnx.OnlineRecognizer.from_transducer(
|
|
|
215 |
clean = w.replace("\\", "").replace("<unk>", "").strip()
|
216 |
if clean: # only write non-empty lines
|
217 |
tf.write(f"{clean}\n")
|
218 |
+
tf.flush()
|
219 |
+
tf.close()
|
220 |
+
hotwords_file_path = tf.name
|
221 |
+
print(f"[DEBUG asr_worker] Written {len(hotwords)} hotwords to {hotwords_file_path} with score {hotwords_score}")
|
222 |
|
223 |
# Create beam-search recognizer with biasing :contentReference[oaicite:0]{index=0}
|
224 |
return sherpa_onnx.OnlineRecognizer.from_transducer(
|