Spaces:
Paused
Paused
Update stt/stt_google.py
Browse files- stt/stt_google.py +9 -7
stt/stt_google.py
CHANGED
|
@@ -22,6 +22,15 @@ class GoogleSTT(STTInterface):
|
|
| 22 |
credentials_path: Path to service account JSON file (optional if using default credentials)
|
| 23 |
"""
|
| 24 |
try:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
# Initialize client
|
| 26 |
if credentials_path:
|
| 27 |
self.client = speech.SpeechClient.from_service_account_file(credentials_path)
|
|
@@ -101,13 +110,6 @@ class GoogleSTT(STTInterface):
|
|
| 101 |
use_enhanced=True,
|
| 102 |
# Single channel audio
|
| 103 |
audio_channel_count=1,
|
| 104 |
-
# Boost adaptation for better Turkish recognition
|
| 105 |
-
speech_contexts=[
|
| 106 |
-
speech.SpeechContext(
|
| 107 |
-
phrases=[], # Boş bırakıyoruz ama context var
|
| 108 |
-
boost=20.0
|
| 109 |
-
)
|
| 110 |
-
],
|
| 111 |
# Alternative transcripts for debugging
|
| 112 |
max_alternatives=1,
|
| 113 |
# Profanity filter disabled for accuracy
|
|
|
|
| 22 |
credentials_path: Path to service account JSON file (optional if using default credentials)
|
| 23 |
"""
|
| 24 |
try:
|
| 25 |
+
# ✅ Debug için path kontrolü
|
| 26 |
+
if credentials_path:
|
| 27 |
+
import os
|
| 28 |
+
if not os.path.exists(credentials_path):
|
| 29 |
+
log_error(f"❌ Credentials file not found at: {credentials_path}")
|
| 30 |
+
raise FileNotFoundError(f"Credentials file not found: {credentials_path}")
|
| 31 |
+
|
| 32 |
+
log_info(f"📁 Using credentials from: {credentials_path}")
|
| 33 |
+
|
| 34 |
# Initialize client
|
| 35 |
if credentials_path:
|
| 36 |
self.client = speech.SpeechClient.from_service_account_file(credentials_path)
|
|
|
|
| 110 |
use_enhanced=True,
|
| 111 |
# Single channel audio
|
| 112 |
audio_channel_count=1,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 113 |
# Alternative transcripts for debugging
|
| 114 |
max_alternatives=1,
|
| 115 |
# Profanity filter disabled for accuracy
|