From 16238fab8a200c9711e97bd0a52554418f8a8530 Mon Sep 17 00:00:00 2001 From: Your Name Date: Thu, 4 Jul 2024 15:09:10 +0500 Subject: [PATCH 1/2] chore: Update .env.sample and .gitignore The .env.sample file was updated to include the NGROK_AUTHTOKEN variable. Additionally, the .gitignore file was modified to include the .env file. --- .env.sample | 4 +++- .gitignore | 4 +++- local_setup/docker-compose.yml | 2 ++ local_setup/ngrok-config.yml | 1 - 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.env.sample b/.env.sample index f42c384..27f8542 100644 --- a/.env.sample +++ b/.env.sample @@ -15,4 +15,6 @@ TWILIO_PHONE_NUMBER= # Plivo credentials PLIVO_AUTH_ID= PLIVO_AUTH_TOKEN= -PLIVO_PHONE_NUMBER= \ No newline at end of file +PLIVO_PHONE_NUMBER= + +NGROK_AUTHTOKEN= \ No newline at end of file diff --git a/.gitignore b/.gitignore index 33986b5..2e7c101 100644 --- a/.gitignore +++ b/.gitignore @@ -167,4 +167,6 @@ agent_data/**/mp3 */__pycache__/ */*/__pycache__/ logs/ -agent_data/ \ No newline at end of file +agent_data/ + +.env \ No newline at end of file diff --git a/local_setup/docker-compose.yml b/local_setup/docker-compose.yml index 24424cc..f986834 100644 --- a/local_setup/docker-compose.yml +++ b/local_setup/docker-compose.yml @@ -36,6 +36,8 @@ services: - ./ngrok-config.yml:/etc/ngrok.yml ports: - 4040:4040 + environment: + - NGROK_AUTHTOKEN=${NGROK_AUTHTOKEN} ### Telephony servers ### twilio-app: diff --git a/local_setup/ngrok-config.yml b/local_setup/ngrok-config.yml index c868f12..07bbfa7 100644 --- a/local_setup/ngrok-config.yml +++ b/local_setup/ngrok-config.yml @@ -1,6 +1,5 @@ region: us version: '2' -authtoken: tunnels: twilio-app: addr: twilio-app:8001 From 36b9cc54821a1786fbfd02cb827c0610919752c3 Mon Sep 17 00:00:00 2001 From: Your Name Date: Thu, 4 Jul 2024 15:20:59 +0500 Subject: [PATCH 2/2] feat: Add support for Russian and Kazakh languages in whisper model The `validate_language` method in the `Transcriber` class now includes support for the Russian and Kazakh languages when the `model` is set to 'whisper'. This change allows for accurate transcription of Russian and Kazakh audio files. --- bolna/models.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/bolna/models.py b/bolna/models.py index 0a028f5..825b211 100644 --- a/bolna/models.py +++ b/bolna/models.py @@ -80,7 +80,7 @@ class Transcriber(BaseModel): encoding: Optional[str] = "linear16" endpointing: Optional[int] = 400 keywords: Optional[str] = None - task:Optional[str] = "transcribe" + task: Optional[str] = "transcribe" provider: Optional[str] = "deepgram" @validator("provider") @@ -88,9 +88,14 @@ def validate_model(cls, value): print(f"value {value}, PROVIDERS {list(SUPPORTED_TRANSCRIBER_PROVIDERS.keys())}") return validate_attribute(value, list(SUPPORTED_TRANSCRIBER_PROVIDERS.keys())) + # Only whisper works well with russian and kazakh @validator("language") - def validate_language(cls, value): - return validate_attribute(value, ["en", "hi", "es", "fr", "pt", "ko", "ja", "zh", "de", "it", "pt-BR"]) + def validate_language(cls, value, values): + supported_languages = ["en", "hi", "es", "fr", "pt", "ko", "ja", "zh", "de", "it", "pt-BR"] + if values.get('model') == 'whisper': + supported_languages.append('ru') + supported_languages.append('kk') + return validate_attribute(value, supported_languages) class Synthesizer(BaseModel):