Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add support for Russian and Kazakh languages in whisper model #313

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,6 @@ TWILIO_PHONE_NUMBER=
# Plivo credentials
PLIVO_AUTH_ID=
PLIVO_AUTH_TOKEN=
PLIVO_PHONE_NUMBER=
PLIVO_PHONE_NUMBER=

NGROK_AUTHTOKEN=
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -167,4 +167,6 @@ agent_data/**/mp3
*/__pycache__/
*/*/__pycache__/
logs/
agent_data/
agent_data/

.env
11 changes: 8 additions & 3 deletions bolna/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,17 +80,22 @@ 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")
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):
Expand Down
2 changes: 2 additions & 0 deletions local_setup/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ services:
- ./ngrok-config.yml:/etc/ngrok.yml
ports:
- 4040:4040
environment:
- NGROK_AUTHTOKEN=${NGROK_AUTHTOKEN}

### Telephony servers ###
twilio-app:
Expand Down
1 change: 0 additions & 1 deletion local_setup/ngrok-config.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
region: us
version: '2'
authtoken: <your-auth-token>
tunnels:
twilio-app:
addr: twilio-app:8001
Expand Down