Skip to content

Commit a553eff

Browse files
authored
Merge pull request Homebrew#263865 from Homebrew/pocket-tts-new-formula
pocket-tts 1.0.2 (new formula)
2 parents 5715732 + 043d650 commit a553eff

File tree

1 file changed

+207
-0
lines changed

1 file changed

+207
-0
lines changed

Formula/p/pocket-tts.rb

Lines changed: 207 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,207 @@
1+
class PocketTts < Formula
2+
include Language::Python::Virtualenv
3+
4+
desc "Text-to-speech application designed to run efficiently on CPUs"
5+
homepage "https://github.com/kyutai-labs/pocket-tts"
6+
url "https://files.pythonhosted.org/packages/8d/41/777d34b5867d3b653a222c8039f110df4d06dfc224dcf018d9100c7a0937/pocket_tts-1.0.2.tar.gz"
7+
sha256 "81239a598cad56a24f117b5c800df2d6a94f573f9a9fe49faf2ca05b258886d4"
8+
license "MIT"
9+
head "https://github.com/kyutai-labs/pocket-tts.git", branch: "main"
10+
11+
bottle do
12+
sha256 cellar: :any, arm64_tahoe: "5e88f18f63cb98c122f563023da5b8878cdf194166329728783b84e089e64815"
13+
sha256 cellar: :any, arm64_sequoia: "bd83d8727a89493e749e959eff76c38022bf11a8ca5eb7d828ad5bb9eef9d30b"
14+
sha256 cellar: :any, arm64_sonoma: "55bfed15a3c324204471b57a893d74756be703258ffa6cf394411bc78654eb71"
15+
sha256 cellar: :any, sonoma: "f412156390de30cb5e53b8306f8924ed460d1b88a6d257a0f55717b8c408d7b9"
16+
sha256 cellar: :any_skip_relocation, arm64_linux: "9698023f2e27a9930c4e5c30cb1daf50cb55f496b9e717ba7ccf7b79f8901daa"
17+
sha256 cellar: :any_skip_relocation, x86_64_linux: "5214f370cfb10e13ca03a0b7969f9d780e605a1cb91d9951be85bc3c5febb5a3"
18+
end
19+
20+
depends_on "cmake" => :build
21+
depends_on "rust" => :build
22+
depends_on "certifi" => :no_linkage
23+
depends_on "libyaml"
24+
depends_on "pydantic" => :no_linkage
25+
depends_on "python@3.14"
26+
depends_on "pytorch"
27+
depends_on "scipy" => :no_linkage
28+
29+
pypi_packages exclude_packages: %w[certifi pydantic scipy torch]
30+
31+
resource "annotated-doc" do
32+
url "https://files.pythonhosted.org/packages/57/ba/046ceea27344560984e26a590f90bc7f4a75b06701f653222458922b558c/annotated_doc-0.0.4.tar.gz"
33+
sha256 "fbcda96e87e9c92ad167c2e53839e57503ecfda18804ea28102353485033faa4"
34+
end
35+
36+
resource "anyio" do
37+
url "https://files.pythonhosted.org/packages/96/f0/5eb65b2bb0d09ac6776f2eb54adee6abe8228ea05b20a5ad0e4945de8aac/anyio-4.12.1.tar.gz"
38+
sha256 "41cfcc3a4c85d3f05c932da7c26d0201ac36f72abd4435ba90d0464a3ffed703"
39+
end
40+
41+
resource "beartype" do
42+
url "https://files.pythonhosted.org/packages/c7/94/1009e248bbfbab11397abca7193bea6626806be9a327d399810d523a07cb/beartype-0.22.9.tar.gz"
43+
sha256 "8f82b54aa723a2848a56008d18875f91c1db02c32ef6a62319a002e3e25a975f"
44+
end
45+
46+
resource "charset-normalizer" do
47+
url "https://files.pythonhosted.org/packages/13/69/33ddede1939fdd074bce5434295f38fae7136463422fe4fd3e0e89b98062/charset_normalizer-3.4.4.tar.gz"
48+
sha256 "94537985111c35f28720e43603b8e7b43a6ecfb2ce1d3058bbe955b73404e21a"
49+
end
50+
51+
resource "click" do
52+
url "https://files.pythonhosted.org/packages/3d/fa/656b739db8587d7b5dfa22e22ed02566950fbfbcdc20311993483657a5c0/click-8.3.1.tar.gz"
53+
sha256 "12ff4785d337a1bb490bb7e9c2b1ee5da3112e94a8622f26a6c77f5d2fc6842a"
54+
end
55+
56+
resource "einops" do
57+
url "https://files.pythonhosted.org/packages/e5/81/df4fbe24dff8ba3934af99044188e20a98ed441ad17a274539b74e82e126/einops-0.8.1.tar.gz"
58+
sha256 "de5d960a7a761225532e0f1959e5315ebeafc0cd43394732f103ca44b9837e84"
59+
end
60+
61+
resource "fastapi" do
62+
url "https://files.pythonhosted.org/packages/52/08/8c8508db6c7b9aae8f7175046af41baad690771c9bcde676419965e338c7/fastapi-0.128.0.tar.gz"
63+
sha256 "1cc179e1cef10a6be60ffe429f79b829dce99d8de32d7acb7e6c8dfdf7f2645a"
64+
end
65+
66+
resource "h11" do
67+
url "https://files.pythonhosted.org/packages/01/ee/02a2c011bdab74c6fb3c75474d40b3052059d95df7e73351460c8588d963/h11-0.16.0.tar.gz"
68+
sha256 "4e35b956cf45792e4caa5885e69fba00bdbc6ffafbfa020300e549b208ee5ff1"
69+
end
70+
71+
resource "hf-xet" do
72+
url "https://files.pythonhosted.org/packages/5e/6e/0f11bacf08a67f7fb5ee09740f2ca54163863b07b70d579356e9222ce5d8/hf_xet-1.2.0.tar.gz"
73+
sha256 "a8c27070ca547293b6890c4bf389f713f80e8c478631432962bb7f4bc0bd7d7f"
74+
end
75+
76+
resource "httpcore" do
77+
url "https://files.pythonhosted.org/packages/06/94/82699a10bca87a5556c9c59b5963f2d039dbd239f25bc2a63907a05a14cb/httpcore-1.0.9.tar.gz"
78+
sha256 "6e34463af53fd2ab5d807f399a9b45ea31c3dfa2276f15a2c3f00afff6e176e8"
79+
end
80+
81+
resource "httpx" do
82+
url "https://files.pythonhosted.org/packages/b1/df/48c586a5fe32a0f01324ee087459e112ebb7224f646c0b5023f5e79e9956/httpx-0.28.1.tar.gz"
83+
sha256 "75e98c5f16b0f35b567856f597f06ff2270a374470a5c2392242528e3e3e42fc"
84+
end
85+
86+
resource "huggingface-hub" do
87+
url "https://files.pythonhosted.org/packages/ba/d6/02d1c505e1d3364230e5fa16d2b58c8f36a39c5efe8e99bc4d03d06fd0ca/huggingface_hub-1.3.2.tar.gz"
88+
sha256 "15d7902e154f04174a0816d1e9594adcf15cdad57596920a5dc70fadb5d896c7"
89+
end
90+
91+
resource "idna" do
92+
url "https://files.pythonhosted.org/packages/6f/6d/0703ccc57f3a7233505399edb88de3cbd678da106337b9fcde432b65ed60/idna-3.11.tar.gz"
93+
sha256 "795dafcc9c04ed0c1fb032c2aa73654d8e8c5023a7df64a53f39190ada629902"
94+
end
95+
96+
resource "markdown-it-py" do
97+
url "https://files.pythonhosted.org/packages/5b/f5/4ec618ed16cc4f8fb3b701563655a69816155e79e24a17b651541804721d/markdown_it_py-4.0.0.tar.gz"
98+
sha256 "cb0a2b4aa34f932c007117b194e945bd74e0ec24133ceb5bac59009cda1cb9f3"
99+
end
100+
101+
resource "mdurl" do
102+
url "https://files.pythonhosted.org/packages/d6/54/cfe61301667036ec958cb99bd3efefba235e65cdeb9c84d24a8293ba1d90/mdurl-0.1.2.tar.gz"
103+
sha256 "bb413d29f5eea38f31dd4754dd7377d4465116fb207585f97bf925588687c1ba"
104+
end
105+
106+
resource "packaging" do
107+
url "https://files.pythonhosted.org/packages/a1/d4/1fc4078c65507b51b96ca8f8c3ba19e6a61c8253c72794544580a7b6c24d/packaging-25.0.tar.gz"
108+
sha256 "d443872c98d677bf60f6a1f2f8c1cb748e8fe762d2bf9d3148b5599295b0fc4f"
109+
end
110+
111+
resource "pygments" do
112+
url "https://files.pythonhosted.org/packages/b0/77/a5b8c569bf593b0140bde72ea885a803b82086995367bf2037de0159d924/pygments-2.19.2.tar.gz"
113+
sha256 "636cb2477cec7f8952536970bc533bc43743542f70392ae026374600add5b887"
114+
end
115+
116+
resource "python-multipart" do
117+
url "https://files.pythonhosted.org/packages/78/96/804520d0850c7db98e5ccb70282e29208723f0964e88ffd9d0da2f52ea09/python_multipart-0.0.21.tar.gz"
118+
sha256 "7137ebd4d3bbf70ea1622998f902b97a29434a9e8dc40eb203bbcf7c2a2cba92"
119+
end
120+
121+
resource "pyyaml" do
122+
url "https://files.pythonhosted.org/packages/05/8e/961c0007c59b8dd7729d542c61a4d537767a59645b82a0b521206e1e25c2/pyyaml-6.0.3.tar.gz"
123+
sha256 "d76623373421df22fb4cf8817020cbb7ef15c725b9d5e45f17e189bfc384190f"
124+
end
125+
126+
resource "requests" do
127+
url "https://files.pythonhosted.org/packages/c9/74/b3ff8e6c8446842c3f5c837e9c3dfcfe2018ea6ecef224c710c85ef728f4/requests-2.32.5.tar.gz"
128+
sha256 "dbba0bac56e100853db0ea71b82b4dfd5fe2bf6d3754a8893c3af500cec7d7cf"
129+
end
130+
131+
resource "rich" do
132+
url "https://files.pythonhosted.org/packages/fb/d2/8920e102050a0de7bfabeb4c4614a49248cf8d5d7a8d01885fbb24dc767a/rich-14.2.0.tar.gz"
133+
sha256 "73ff50c7c0c1c77c8243079283f4edb376f0f6442433aecb8ce7e6d0b92d1fe4"
134+
end
135+
136+
resource "safetensors" do
137+
url "https://files.pythonhosted.org/packages/29/9c/6e74567782559a63bd040a236edca26fd71bc7ba88de2ef35d75df3bca5e/safetensors-0.7.0.tar.gz"
138+
sha256 "07663963b67e8bd9f0b8ad15bb9163606cd27cc5a1b96235a50d8369803b96b0"
139+
end
140+
141+
resource "sentencepiece" do
142+
url "https://files.pythonhosted.org/packages/15/15/2e7a025fc62d764b151ae6d0f2a92f8081755ebe8d4a64099accc6f77ba6/sentencepiece-0.2.1.tar.gz"
143+
sha256 "8138cec27c2f2282f4a34d9a016e3374cd40e5c6e9cb335063db66a0a3b71fad"
144+
end
145+
146+
resource "shellingham" do
147+
url "https://files.pythonhosted.org/packages/58/15/8b3609fd3830ef7b27b655beb4b4e9c62313a4e8da8c676e142cc210d58e/shellingham-1.5.4.tar.gz"
148+
sha256 "8dbca0739d487e5bd35ab3ca4b36e11c4078f3a234bfce294b0a0291363404de"
149+
end
150+
151+
resource "starlette" do
152+
url "https://files.pythonhosted.org/packages/ba/b8/73a0e6a6e079a9d9cfa64113d771e421640b6f679a52eeb9b32f72d871a1/starlette-0.50.0.tar.gz"
153+
sha256 "a2a17b22203254bcbc2e1f926d2d55f3f9497f769416b3190768befe598fa3ca"
154+
end
155+
156+
resource "tqdm" do
157+
url "https://files.pythonhosted.org/packages/a8/4b/29b4ef32e036bb34e4ab51796dd745cdba7ed47ad142a9f4a1eb8e0c744d/tqdm-4.67.1.tar.gz"
158+
sha256 "f8aef9c52c08c13a65f30ea34f4e5aac3fd1a34959879d7e59e63027286627f2"
159+
end
160+
161+
resource "typer" do
162+
url "https://files.pythonhosted.org/packages/36/bf/8825b5929afd84d0dabd606c67cd57b8388cb3ec385f7ef19c5cc2202069/typer-0.21.1.tar.gz"
163+
sha256 "ea835607cd752343b6b2b7ce676893e5a0324082268b48f27aa058bdb7d2145d"
164+
end
165+
166+
resource "typer-slim" do
167+
url "https://files.pythonhosted.org/packages/17/d4/064570dec6358aa9049d4708e4a10407d74c99258f8b2136bb8702303f1a/typer_slim-0.21.1.tar.gz"
168+
sha256 "73495dd08c2d0940d611c5a8c04e91c2a0a98600cbd4ee19192255a233b6dbfd"
169+
end
170+
171+
resource "urllib3" do
172+
url "https://files.pythonhosted.org/packages/c7/24/5f1b3bdffd70275f6661c76461e25f024d5a38a46f04aaca912426a2b1d3/urllib3-2.6.3.tar.gz"
173+
sha256 "1b62b6884944a57dbe321509ab94fd4d3b307075e0c2eae991ac71ee15ad38ed"
174+
end
175+
176+
resource "uvicorn" do
177+
url "https://files.pythonhosted.org/packages/c3/d1/8f3c683c9561a4e6689dd3b1d345c815f10f86acd044ee1fb9a4dcd0b8c5/uvicorn-0.40.0.tar.gz"
178+
sha256 "839676675e87e73694518b5574fd0f24c9d97b46bea16df7b8c05ea1a51071ea"
179+
end
180+
181+
def install
182+
venv = virtualenv_install_with_resources(without: "hf-xet")
183+
184+
resource("hf-xet").stage do
185+
# Disable sha2-asm on ARM which requires -march=armv8-a+crypto
186+
if ENV.effective_arch == :armv8
187+
inreplace "data/Cargo.toml",
188+
'sha2 = { workspace = true, features = ["asm"] }',
189+
"sha2 = { workspace = true }"
190+
end
191+
venv.pip_install Pathname.pwd
192+
end
193+
194+
# We depend on pytorch, but that's a separate formula, so install a `.pth` file to link them.
195+
# NOTE: This is an exception to our usual policy as building `pytorch` is complicated
196+
site_packages = Language::Python.site_packages(venv.root/"bin/python3")
197+
pth_contents = "import site; site.addsitedir('#{Formula["pytorch"].opt_libexec/site_packages}')\n"
198+
(venv.site_packages/"homebrew-pytorch.pth").write pth_contents
199+
200+
generate_completions_from_executable(bin/"pocket-tts", shell_parameter_format: :typer)
201+
end
202+
203+
test do
204+
assert_match "Results written in ./tts_output.wav",
205+
shell_output("#{bin}/pocket-tts generate 2>&1")
206+
end
207+
end

0 commit comments

Comments
 (0)