Skip to content

Add Dockerized CPU deployment and Gradio UI configuration#232

Open
khanhhuyenpham wants to merge 2 commits into
k2-fsa:masterfrom
khanhhuyenpham:feature/docker-ui
Open

Add Dockerized CPU deployment and Gradio UI configuration#232
khanhhuyenpham wants to merge 2 commits into
k2-fsa:masterfrom
khanhhuyenpham:feature/docker-ui

Conversation

@khanhhuyenpham

Copy link
Copy Markdown

No description provided.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces Docker deployment support for OmniVoice, adding Dockerfiles, Docker Compose configurations for both CPU and GPU environments, and a detailed README guide. Additionally, the CLI demo script was updated to dynamically set the PyTorch data type based on the device. The feedback suggests restricting torch.float16 to cuda and xpu devices to avoid compatibility issues on Apple Silicon (MPS), and replacing the hardcoded commit hash image tag with a generic tag like latest in the Docker Compose and documentation files.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread omnivoice/cli/demo.py
parser.print_help()
return 0
logging.info(f"Loading model from {checkpoint}, device={device} ...")
dtype = torch.float32 if str(device).startswith("cpu") else torch.float16

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

Using torch.float16 on Apple Silicon (MPS) can lead to runtime errors or numerical instability due to incomplete operator support for half-precision on MPS. To ensure compatibility and consistency with the ASR model's dtype selection (which uses float32 for non-CUDA/non-XPU devices), we should use torch.float16 only for cuda and xpu devices, and default to torch.float32 for others (including cpu and mps).

Suggested change
dtype = torch.float32 if str(device).startswith("cpu") else torch.float16
dtype = torch.float16 if str(device).startswith(("cuda", "xpu")) else torch.float32

Comment thread compose.yaml
build:
context: .
dockerfile: Dockerfile
image: omnivoice-ui:468e927

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The default image tag is hardcoded to a specific commit hash (468e927). This can cause issues if users try to run the compose file without building it locally, or if they expect a standard tag like latest or gpu to match the cpu tag in compose.cpu.yaml. It is recommended to use a generic tag like latest or gpu for the default image.

    image: omnivoice-ui:latest

Comment thread README-docker.md
Verify CUDA packaging without loading the model:

```bash
docker run --rm --entrypoint python omnivoice-ui:468e927 -c \

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The smoke test command uses the hardcoded commit hash tag omnivoice-ui:468e927. This should be updated to use the generic latest or gpu tag to match the default compose configuration.

Suggested change
docker run --rm --entrypoint python omnivoice-ui:468e927 -c \
docker run --rm --entrypoint python omnivoice-ui:latest -c \

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants