Skip to content

A voice translator created in Python using the flow: voice to text, translation and than text to voice.

Notifications You must be signed in to change notification settings

lucasvmigotto/voice-translator

Repository files navigation

title emoji colorFrom colorTo sdk sdk_version app_file pinned
Voice Translator
💻
purple
indigo
gradio
4.44.0
src/app.py
false

voice-translator

Voice to voice translator based in AssemblyAI-Community/Voice-to-Voice-translator project.

Pre-requisites

Development

  1. Create a copy of .env.example names as .env

    Place your Api Keys here

  2. Press CTRL + P (or F11) and select Dev Containers: Rebuild Container Without Cache

  3. Install dependencies:

    poetry install
  4. Happy coding 😄

Running

  • To start the application, run the following command:

    poetry run python src/app.py

Deploy

Docker Image

  • Define some env vars

    CONTAINER_REPOSITORY='us-central1-docker.pkg.dev/voice-translator/voice-translator'
    IMAGE_NAME='voice-translator'
    TAG="$(git describe --tags --abbrev=0)"
    CONTAINER_PUSH_NAME="${CONTAINER_REPOSITORY}/${IMAGE_NAME}:${TAG}"
  • Build the image

    docker build \
      -f Dockerfile \
      --tag "${CONTAINER_PUSH_NAME}" \
      --progress plain \
      --no-cache \
      --debug \
      .
  • Test the image

    docker run \
      --rm \
      --name 'voice-translator-container-test' \
      --env ELEVENLABS_API_KEY='<Your API Key>' \
      --env ASSEMBLYAI_API_KEY='<Your API Key>' \
      --publish 7860:7860 \
      --network bridge \
      "${CONTAINER_PUSH_NAME}"

    Use docker container rm -f $(docker container ls -qf 'name=voice-translator*') to clean any running container

Configurations

  • To override any setting inside application.toml, set an env var with the section(s) and key name

    i.e. for the setting:

    [app.logging]
    level = 'DEBUG'

    Set an env var as:

    export APP_LOGGING_LEVEL=INFO

References

About

A voice translator created in Python using the flow: voice to text, translation and than text to voice.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published