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

upgrade deps #362

Merged
merged 3 commits into from
Mar 6, 2025
Merged
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
3 changes: 3 additions & 0 deletions contributing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
uv venv
source .venv/bin/activate
uv sync --all-extras
4 changes: 0 additions & 4 deletions docs/usage/text-to-speech.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
!!! warning

`rhasspy/piper-voices` is only supported on x86_64. I was unable to build [piper-phonemize](https://github.com/rhasspy/piper-phonemize) for ARM. If you have experience building Python packages with third-party C++ dependencies, please consider contributing. See [#234](https://github.com/speaches-ai/speaches/issues/234) for more information.

!!! note

Before proceeding, you should be familiar with the [OpenAI Text-to-Speech](https://platform.openai.com/docs/guides/text-to-speech) and the relevant [OpenAI API reference](https://platform.openai.com/docs/api-reference/audio/createSpeech)
Expand Down
13 changes: 7 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ dependencies = [
"fastapi>=0.115.6",
"faster-whisper>=1.1.1",
"huggingface-hub[hf-transfer]>=0.25.1",
"kokoro-onnx[gpu]>=0.4.2,<0.5.0",
"kokoro-onnx[gpu]>=0.4.5,<0.5.0",
"numpy>=2.1.1",
"piper-phonemize ; platform_machine == 'x86_64'",
"piper-tts>=1.2.0 ; platform_machine == 'x86_64'",
"piper-phonemize ; sys_platform == 'linux'",
"piper-tts>=1.2.0 ; sys_platform == 'linux'",
"pydantic-settings>=2.5.2",
"pydantic>=2.10.0",
"python-multipart>=0.0.10",
Expand Down Expand Up @@ -148,11 +148,12 @@ markers = [

[tool.uv]
constraint-dependencies = ["llvmlite>=0.40.0"]
# TODO: create an issue on https://github.com/thewh1teagle/kokoro-onnx regarding this
override-dependencies = ["onnxruntime-gpu>=1.20.1 ; platform_machine == 'x86_64'"]

[tool.uv.sources]
piper-phonemize = { url = "https://github.com/fedirz/piper-phonemize/raw/refs/heads/master/dist/piper_phonemize-1.2.0-cp312-cp312-manylinux_2_28_x86_64.whl" }
piper-phonemize = [
{ url = "https://github.com/fedirz/piper-phonemize/raw/refs/heads/master/dist/piper_phonemize-1.2.0-cp312-cp312-manylinux_2_28_aarch64.whl", marker = "platform_machine == 'aarch64' and sys_platform == 'linux'" },
{ url = "https://github.com/fedirz/piper-phonemize/raw/refs/heads/master/dist/piper_phonemize-1.2.0-cp312-cp312-manylinux_2_28_x86_64.whl", marker = "platform_machine == 'x86_64' and sys_platform == 'linux'" },
]

[[tool.uv.dependency-metadata]]
name = "piper-tts"
Expand Down
4 changes: 0 additions & 4 deletions src/speaches/main.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from __future__ import annotations

import logging
import platform

from fastapi import (
FastAPI,
Expand Down Expand Up @@ -59,9 +58,6 @@ def create_app() -> FastAPI:

logger.debug(f"Config: {config}")

if platform.machine() != "x86_64":
logger.warning("`POST /v1/audio/speech` with `model=rhasspy/piper-voices` is only supported on x86_64 machines")

dependencies = []
if config.api_key is not None:
dependencies.append(ApiKeyDependency)
Expand Down
7 changes: 1 addition & 6 deletions tests/speech_test.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
import io
import platform

from openai import AsyncOpenAI, UnprocessableEntityError
import pytest
import soundfile as sf

platform_machine = platform.machine()
if platform_machine != "x86_64":
pytest.skip("Only supported on x86_64", allow_module_level=True)

from speaches.routers.speech import ( # noqa: E402
from speaches.routers.speech import (
DEFAULT_MODEL_ID,
DEFAULT_RESPONSE_FORMAT,
DEFAULT_VOICE_ID,
Expand Down
Loading
Loading