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

Unraid Install issuse #86

Closed
shoyrock opened this issue Jan 21, 2025 · 3 comments
Closed

Unraid Install issuse #86

shoyrock opened this issue Jan 21, 2025 · 3 comments

Comments

@shoyrock
Copy link

Can someone let me know what I’m doing wrong? I’ve been unable to get this working.

Image

Image

/usr/local/bin/python: No module named uvicorn

Image

docker run
-d
--name='Kokoro-FastAPI'
--net='bridge'
--pids-limit 2048
-e TZ="America/New_York"
-e HOST_OS="Unraid"
-e HOST_HOSTNAME="EasyMedia"
-e HOST_CONTAINERNAME="Kokoro-FastAPI"
-l net.unraid.docker.managed=dockerman
-l net.unraid.docker.webui='http://[IP]:[PORT:7860]/'
-p '8880:8880/tcp'
-p '7860:7860/tcp'
-v '/mnt/user/appdata/Kokoro-FastAPI':'/app':'rw' 'ghcr.io/remsky/kokoro-fastapi-cpu:v0.1.0post1'
eb476bc6425586fec6a22782cdffab71da0c461496133399e31c42ef8bffaabe

@remsky
Copy link
Owner

remsky commented Jan 24, 2025

I'm not familiar with unraid, it seems like quite a few options being set I'm not familiar with as well. You could try running the cpu:latest version. It could have some bugs, but is more self contained and configurable. Its from the v0.1.2-pre branch

@shoyrock
Copy link
Author

docker run
-d
--name='Kokoro-FastAPI'
--net='utilities'
--pids-limit 2048
--privileged=true
-e TZ="America/New_York"
-e HOST_OS="Unraid"
-e HOST_HOSTNAME="EasyMedia"
-e HOST_CONTAINERNAME="Kokoro-FastAPI"
-e 'PUID'='1000'
-e 'PGID'='1000'
-l net.unraid.docker.managed=dockerman
-l net.unraid.docker.webui='http://[IP]:[PORT:8880]/'
-p '8880:8880/tcp'
-v '/mnt/cache/appdata/Kokoro-FastAPI/api/':'/app':'rw' 'ghcr.io/remsky/kokoro-fastapi-cpu:latest'
7ef121313686e77a11e6eac7808c5a458498d7ef8fda79c9b68930c60bfc7bbe

The command finished successfully!

log:
/usr/local/bin/python: No module named uvicorn

i wasnt not able to get v0.1.2-pre installed


/mnt/user/appdata/Kokoro-FastAPI/docker/cpu# docker compose up --build
[+] Building 157.2s (32/32) FINISHED docker:default
=> [kokoro-tts internal] load build definition from Dockerfile 0.1s
=> => transferring dockerfile: 1.90kB 0.0s
=> [gradio-ui internal] load build definition from Dockerfile 0.1s
=> => transferring dockerfile: 348B 0.0s
=> [kokoro-tts internal] load metadata for ghcr.io/astral-sh/uv:latest 0.9s
=> [gradio-ui internal] load metadata for docker.io/library/python:3.10-slim 1.3s
=> [gradio-ui auth] library/python:pull token for registry-1.docker.io 0.0s
=> [gradio-ui internal] load .dockerignore 0.1s
=> => transferring context: 2B 0.0s
=> [kokoro-tts internal] load .dockerignore 0.1s
=> => transferring context: 367B 0.0s
=> CACHED [gradio-ui 1/5] FROM docker.io/library/python:3.10-slim@sha256:a636f5aafba3654ac4d04d7c234a75b77fa26646fe0dafe4654b731bc413b02f 0.0s
=> [gradio-ui internal] load build context 0.1s
=> => transferring context: 684.70kB 0.0s
=> CACHED [gradio-ui 2/5] WORKDIR /app/ui 0.0s
=> [kokoro-tts internal] load build context 0.1s
=> => transferring context: 6.46MB 0.0s
=> [kokoro-tts] FROM ghcr.io/astral-sh/uv:latest@sha256:2381d6aa60c326b71fd40023f921a0a3b8f91b14d5db6b90402e65a635053709 2.5s
=> => resolve ghcr.io/astral-sh/uv:latest@sha256:2381d6aa60c326b71fd40023f921a0a3b8f91b14d5db6b90402e65a635053709 0.2s
=> => sha256:2381d6aa60c326b71fd40023f921a0a3b8f91b14d5db6b90402e65a635053709 2.19kB / 2.19kB 0.0s
=> => sha256:1a17aac5aea0346d36ee2376d8003ecf244d439ca9c43d4e1ce3d134a10b46c1 669B / 669B 0.0s
=> => sha256:421be5100ab256589e5a6e3f2d8261de0b69905312d3f53e62e47bf4cd936069 1.30kB / 1.30kB 0.0s
=> => sha256:9270565dea0adff71987df4e017d582429ea066fe2e3c802dc0d8b8d8d38d92d 16.07MB / 16.07MB 1.7s
=> => sha256:d37c76d43895e16bc64c22c3b44d308cff83323aa91c57ba072e5cf13827cdd6 94B / 94B 0.2s
=> => extracting sha256:9270565dea0adff71987df4e017d582429ea066fe2e3c802dc0d8b8d8d38d92d 0.3s
=> => extracting sha256:d37c76d43895e16bc64c22c3b44d308cff83323aa91c57ba072e5cf13827cdd6 0.1s
=> [gradio-ui 3/5] RUN pip install gradio==5.9.1 requests==2.32.3 44.6s
=> [kokoro-tts stage-0 2/14] RUN apt-get update && apt-get install -y --no-install-recommends espeak-ng git libsndfile1 curl ffmpeg & 77.5s
=> [gradio-ui 4/5] RUN mkdir -p data/inputs data/outputs 1.4s
=> [gradio-ui 5/5] COPY . . 0.3s
=> [gradio-ui] exporting to image 2.4s
=> => exporting layers 2.3s
=> => writing image sha256:561e6db821866c361aca8de6009cae1a7d7e77ee0aa8162a8bc84130402c6668 0.0s
=> => naming to ghcr.io/remsky/kokoro-fastapi-ui:v0.1.0 0.0s
=> [gradio-ui] resolving provenance for metadata file 0.0s
=> [kokoro-tts stage-0 3/14] COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/ 0.4s
=> [kokoro-tts stage-0 4/14] RUN useradd -m -u 1000 appuser 0.4s
=> [kokoro-tts stage-0 5/14] RUN mkdir -p /app/models && mkdir -p /app/api/src/voices && chown -R appuser:appuser /app 0.4s
=> [kokoro-tts stage-0 6/14] WORKDIR /app/models 0.2s
=> [kokoro-tts stage-0 7/14] RUN set -x && curl -L -o model.tar.gz https://github.com/remsky/Kokoro-FastAPI/releases/download/v0.0.1/kokoro-82m-onnx.tar. 30.3s
=> [kokoro-tts stage-0 8/14] WORKDIR /app/api/src/voices 1.2s
=> [kokoro-tts stage-0 9/14] RUN curl -L -o voices.tar.gz https://github.com/remsky/Kokoro-FastAPI/releases/download/v0.0.1/voice-models.tar.gz && tar xzf 1.4s
=> [kokoro-tts stage-0 10/14] WORKDIR /app 1.3s
=> [kokoro-tts stage-0 11/14] COPY --chown=appuser:appuser pyproject.toml ./pyproject.toml 0.2s
=> [kokoro-tts stage-0 12/14] RUN --mount=type=cache,target=/root/.cache/uv uv venv && uv sync --extra cpu --no-install-project 34.6s
=> [kokoro-tts stage-0 13/14] COPY --chown=appuser:appuser api ./api 0.6s
=> [kokoro-tts stage-0 14/14] RUN --mount=type=cache,target=/root/.cache/uv uv sync --extra cpu 1.4s
=> [kokoro-tts] exporting to image 5.2s
=> => exporting layers 5.1s
=> => writing image sha256:b39766923e51094a93651823a687141a34619faa63c4d57b9bb261148774a6e0 0.0s
=> => naming to docker.io/library/kokoro-tts-kokoro-tts 0.0s
=> [kokoro-tts] resolving provenance for metadata file 0.0s
[+] Running 2/2
✔ Container kokoro-tts-kokoro-tts-1 Created 0.1s
✔ Container kokoro-tts-gradio-ui-1 Created 0.1s
Attaching to gradio-ui-1, kokoro-tts-1
gradio-ui-1 | * Running on local URL: http://0.0.0.0:7860
gradio-ui-1 |
gradio-ui-1 | To create a public link, set share=True in launch().
kokoro-tts-1 | INFO: Started server process [9]
kokoro-tts-1 | INFO: Waiting for application startup.
kokoro-tts-1 | 05:00:40 PM | INFO | Loading TTS model and voice packs...
kokoro-tts-1 | 05:00:40 PM | INFO | CUDA available: False
kokoro-tts-1 | 05:00:40 PM | INFO | Initializing model on cpu
kokoro-tts-1 | 05:00:40 PM | INFO | Model dir: /app/models
kokoro-tts-1 | 05:00:40 PM | INFO | Model path: /app/models/kokoro-v0_19.onnx
kokoro-tts-1 | 05:00:40 PM | INFO | Files in model dir: ['kokoro-v0_19.onnx']
kokoro-tts-1 | 05:00:40 PM | INFO | Loading ONNX model from /app/models/kokoro-v0_19.onnx
kokoro-tts-1 | 05:00:41 PM | INFO | Pre-loaded 1 voices into cache
kokoro-tts-1 | 05:00:41 PM | INFO | Running warmup inference on voice af
kokoro-tts-1 | 05:00:49 PM | INFO | Completed warmup for voice af
kokoro-tts-1 | 05:00:49 PM | INFO | Model warm-up complete
kokoro-tts-1 | 05:00:49 PM | INFO |
kokoro-tts-1 |
kokoro-tts-1 | ░░░░░░░░░░░░░░░░░░░░░░░░
kokoro-tts-1 |
kokoro-tts-1 | ╔═╗┌─┐┌─┐┌┬┐
kokoro-tts-1 | ╠╣ ├─┤└─┐ │
kokoro-tts-1 | ╚ ┴ ┴└─┘ ┴
kokoro-tts-1 | ╦╔═┌─┐┬┌─┌─┐
kokoro-tts-1 | ╠╩╗│ │├┴┐│ │
kokoro-tts-1 | ╩ ╩└─┘┴ ┴└─┘
kokoro-tts-1 |
kokoro-tts-1 | ░░░░░░░░░░░░░░░░░░░░░░░░
kokoro-tts-1 |
kokoro-tts-1 | Model warmed up on cpu
kokoro-tts-1 | 12 voice packs loaded
kokoro-tts-1 |
kokoro-tts-1 | ░░░░░░░░░░░░░░░░░░░░░░░░
kokoro-tts-1 |
kokoro-tts-1 | INFO: Application startup complete.
kokoro-tts-1 | INFO: Uvicorn running on http://0.0.0.0:8880 (Press CTRL+C to quit)

i was about to get the docker-compose working but i dont know why docker run isnt


i tested docker run again after trying to use docker compose and im now getting this

Using CPython 3.10.16 interpreter at: /usr/local/bin/python3.10
Creating virtual environment at: .venv
Installed 83 packages in 675ms
Traceback (most recent call last):
File "/usr/local/lib/python3.10/runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/usr/local/lib/python3.10/runpy.py", line 86, in _run_code
exec(code, run_globals)
File "/app/.venv/lib/python3.10/site-packages/uvicorn/main.py", line 4, in
uvicorn.main()
File "/app/.venv/lib/python3.10/site-packages/click/core.py", line 1161, in call
return self.main(*args, **kwargs)
File "/app/.venv/lib/python3.10/site-packages/click/core.py", line 1082, in main
rv = self.invoke(ctx)
File "/app/.venv/lib/python3.10/site-packages/click/core.py", line 1443, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/app/.venv/lib/python3.10/site-packages/click/core.py", line 788, in invoke
return __callback(*args, **kwargs)
File "/app/.venv/lib/python3.10/site-packages/uvicorn/main.py", line 412, in main
run(
File "/app/.venv/lib/python3.10/site-packages/uvicorn/main.py", line 579, in run
server.run()
File "/app/.venv/lib/python3.10/site-packages/uvicorn/server.py", line 66, in run
return asyncio.run(self.serve(sockets=sockets))
File "/usr/local/lib/python3.10/asyncio/runners.py", line 44, in run
return loop.run_until_complete(main)
File "/usr/local/lib/python3.10/asyncio/base_events.py", line 649, in run_until_complete
return future.result()
File "/app/.venv/lib/python3.10/site-packages/uvicorn/server.py", line 70, in serve
await self._serve(sockets)
File "/app/.venv/lib/python3.10/site-packages/uvicorn/server.py", line 77, in _serve
config.load()
File "/app/.venv/lib/python3.10/site-packages/uvicorn/config.py", line 435, in load
self.loaded_app = import_from_string(self.app)
File "/app/.venv/lib/python3.10/site-packages/uvicorn/importer.py", line 22, in import_from_string
raise exc from None
File "/app/.venv/lib/python3.10/site-packages/uvicorn/importer.py", line 19, in import_from_string
module = importlib.import_module(module_str)
File "/usr/local/lib/python3.10/importlib/init.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1050, in _gcd_import
File "", line 1027, in _find_and_load
File "", line 1006, in _find_and_load_unlocked
File "", line 688, in _load_unlocked
File "", line 883, in exec_module
File "", line 241, in _call_with_frames_removed
File "/app/api/src/main.py", line 14, in
from .routers.development import router as dev_router
File "/app/api/src/routers/development.py", line 7, in
from ..services.audio import AudioService
File "/app/api/src/services/init.py", line 1, in
from .tts_service import TTSService
File "/app/api/src/services/tts_service.py", line 11, in
import torch
ModuleNotFoundError: No module named 'torch'

@remsky
Copy link
Owner

remsky commented Feb 2, 2025

New release should be much simple if you try the docker run command, and try the integrated webui. If not, let me know, and feel free to open a new issue

@remsky remsky closed this as completed Feb 2, 2025
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

No branches or pull requests

2 participants