Spaces:
Building
Building
Update stt/stt_google.py
Browse files- stt/stt_google.py +8 -4
stt/stt_google.py
CHANGED
@@ -123,10 +123,8 @@ class GoogleSTT(STTInterface):
|
|
123 |
# ✅ Streaming config - optimized for final results only
|
124 |
self.streaming_config = StreamingRecognitionConfig(
|
125 |
config=recognition_config,
|
126 |
-
|
127 |
-
|
128 |
-
# ✅ No interim results - only final
|
129 |
-
interim_results=False
|
130 |
)
|
131 |
|
132 |
log_info(f"🔧 Google STT config: language={language_code}, "
|
@@ -181,6 +179,12 @@ class GoogleSTT(STTInterface):
|
|
181 |
|
182 |
# Only process if we have transcript
|
183 |
if alternative.transcript:
|
|
|
|
|
|
|
|
|
|
|
|
|
184 |
transcription_result = TranscriptionResult(
|
185 |
text=alternative.transcript,
|
186 |
is_final=result.is_final,
|
|
|
123 |
# ✅ Streaming config - optimized for final results only
|
124 |
self.streaming_config = StreamingRecognitionConfig(
|
125 |
config=recognition_config,
|
126 |
+
single_utterance=False,
|
127 |
+
interim_results=True
|
|
|
|
|
128 |
)
|
129 |
|
130 |
log_info(f"🔧 Google STT config: language={language_code}, "
|
|
|
179 |
|
180 |
# Only process if we have transcript
|
181 |
if alternative.transcript:
|
182 |
+
# ✅ Interim result'ları logla ama queue'ya koyma
|
183 |
+
if not result.is_final:
|
184 |
+
log_debug(f"📝 Interim transcript (ignored): '{alternative.transcript}'")
|
185 |
+
continue
|
186 |
+
|
187 |
+
# ✅ Sadece final result'ları işle
|
188 |
transcription_result = TranscriptionResult(
|
189 |
text=alternative.transcript,
|
190 |
is_final=result.is_final,
|