Kokoro-FastAPI icon indicating copy to clipboard operation
Kokoro-FastAPI copied to clipboard

Multiple issues on Mac Apple Silicon

Open jsissom opened this issue 1 year ago • 3 comments

When attempting to run start-gpu.sh on Mac with apple silicon, this is the error message:

× No solution found when resolving dependencies: ╰─▶ Because torch==2.6.0+cu124 has no wheels with a matching platform tag (e.g., macosx_15_0_arm64) and kokoro-fastapi[gpu]==0.1.4 depends on torch==2.6.0+cu124, we can conclude that kokoro-fastapi[gpu]==0.1.4 cannot be used. And because only kokoro-fastapi[gpu]==0.1.4 is available and you require kokoro-fastapi[gpu], we can conclude that your requirements are unsatisfiable.

  hint: Wheels are available for `torch` (v2.6.0+cu124) on the following platforms: `linux_x86_64`, `win_amd64`

When running start-cpu.sh on Mac with apple silicon, the app starts up, but any time you want to generate text via the UI, you get this error message:

Error generating speech: MediaSource.addSourceBuffer: Type not supported in MediaSource

Log file: 07:59:58 AM | INFO | text_processor:260 | Yielding final chunk 1: 'this is a test' (14 tokens) 07:59:58 AM | DEBUG | kokoro_v1:250 | Generating audio for text with lang_code 'a': 'this is a test' 07:59:59 AM | DEBUG | kokoro_v1:257 | Got audio chunk with shape: torch.Size([43200]) 07:59:59 AM | INFO | text_processor:266 | Split completed in 413.11ms, produced 1 chunks

jsissom avatar Mar 31 '25 12:03 jsissom

On Mac Apple silicon, I get the same error message when trying to generate text from the web ui when running the docker container: Error generating speech: MediaSource.addSourceBuffer: Type not supported in MediaSource

Docker command ran: docker run -p 8880:8880 ghcr.io/remsky/kokoro-fastapi-cpu:v0.2.2

jsissom avatar Mar 31 '25 12:03 jsissom

Both start-cpu.sh and start-cpu_mac.sh works well on my Mac Mini M4.

Are you using some other browser other than safari in MacOS? The error MediaSource.addSourceBuffer: Type not supported in MediaSource comes from the browser instead of Kokoro-FastAPI.

fondoger avatar Apr 01 '25 16:04 fondoger

The media source issue was because of Firefox. When I use another browser, it works.

The readme file didn't mention the start-gpu_mac.sh file so I was running the start-gpu.sh file. If I run the start-gpu_mac.sh file it works.

Would you like me to create a pull request to fix the documentation about Firefox and the mac version of the script?

Thanks for your help

jsissom avatar Apr 01 '25 16:04 jsissom