{"id":477395,"date":"2026-04-25T17:25:37","date_gmt":"2026-04-25T17:25:37","guid":{"rendered":"https:\/\/savepearlharbor.com\/?p=477395"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=477395","title":{"rendered":"\u041a\u0430\u043a \u044f \u0434\u043e\u0431\u0430\u0432\u0438\u043b llama.cpp \u0431\u044d\u043a\u0435\u043d\u0434 \u0432 CosyVoice3 \u0438 \u0443\u0441\u043a\u043e\u0440\u0438\u043b \u0438\u043d\u0444\u0435\u0440\u0435\u043d\u0441 \u0432 2.6x"},"content":{"rendered":"<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>CosyVoice3 \u2014 \u043e\u0434\u043d\u0430 \u0438\u0437 \u043b\u0443\u0447\u0448\u0438\u0445 open source TTS \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u043f\u0440\u044f\u043c\u043e \u0441\u0435\u0439\u0447\u0430\u0441, \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0434\u043b\u044f \u0440\u0443\u0441\u0441\u043a\u043e\u0433\u043e \u044f\u0437\u044b\u043a\u0430. \u041d\u043e \u0443 \u043d\u0435\u0451 \u0435\u0441\u0442\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430: LLM-\u0447\u0430\u0441\u0442\u044c \u043d\u0430 PyTorch \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u043e \u043d\u0430 \u0441\u043b\u0430\u0431\u044b\u0445 GPU \u0432\u0440\u043e\u0434\u0435 T4. RTF (real-time factor) \u043e\u043a\u043e\u043b\u043e 1.17 \u2014 \u044d\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442 \u0441\u0438\u043d\u0442\u0435\u0437 \u043e\u0434\u043d\u043e\u0439 \u0441\u0435\u043a\u0443\u043d\u0434\u044b \u0430\u0443\u0434\u0438\u043e \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442 \u0431\u043e\u043b\u044c\u0448\u0435 \u0441\u0435\u043a\u0443\u043d\u0434\u044b \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438.<\/p>\n<p>\u042f \u0440\u0435\u0448\u0438\u043b \u044d\u0442\u043e \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c, \u0434\u043e\u0431\u0430\u0432\u0438\u0432 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 llama.cpp \u0447\u0435\u0440\u0435\u0437 llama-cpp-python. \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442: RTF \u0443\u043f\u0430\u043b \u0434\u043e ~0.45, \u0442\u043e \u0435\u0441\u0442\u044c \u0443\u0441\u043a\u043e\u0440\u0435\u043d\u0438\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0432 2.6x.<\/p>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043a\u0430\u043a \u044d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u043f\u043e\u0447\u0435\u043c\u0443 \u044d\u0442\u043e \u043d\u0435\u0442\u0440\u0438\u0432\u0438\u0430\u043b\u044c\u043d\u043e, \u0438 \u043a\u0430\u043a \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u0441\u0430\u043c\u043e\u043c\u0443.<\/p>\n<hr\/>\n<h3>\u041f\u043e\u0447\u0435\u043c\u0443 CosyVoice LLM \u2014 \u043d\u0435 \u043e\u0431\u044b\u0447\u043d\u0430\u044f LLM<\/h3>\n<p>CosyVoice3 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 LLM (\u043d\u0430 \u0431\u0430\u0437\u0435 Qwen2.5-0.5B) \u0434\u043b\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0440\u0435\u0447\u0435\u0432\u044b\u0445 \u0442\u043e\u043a\u0435\u043d\u043e\u0432. \u041d\u043e \u044d\u0442\u043e \u043d\u0435 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u0430\u044f \u044f\u0437\u044b\u043a\u043e\u0432\u0430\u044f \u043c\u043e\u0434\u0435\u043b\u044c \u2014 \u0443 \u043d\u0435\u0451 \u0434\u0432\u0435 \u0433\u043e\u043b\u043e\u0432\u044b \u0438 \u0434\u0432\u0430 \u043d\u0430\u0431\u043e\u0440\u0430 \u044d\u043c\u0431\u0435\u0434\u0434\u0438\u043d\u0433\u043e\u0432:<\/p>\n<ul>\n<li>\n<p><strong>\u0422\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0435 \u044d\u043c\u0431\u0435\u0434\u0434\u0438\u043d\u0433\u0438<\/strong> (<code>embed_tokens<\/code>) \u2014 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 \u0441\u043b\u043e\u0432\u0430\u0440\u044c Qwen, ~151936 \u0442\u043e\u043a\u0435\u043d\u043e\u0432<\/p>\n<\/li>\n<li>\n<p><strong>\u0420\u0435\u0447\u0435\u0432\u044b\u0435 \u044d\u043c\u0431\u0435\u0434\u0434\u0438\u043d\u0433\u0438<\/strong> (<code>speech_embedding<\/code>) \u2014 6561 \u0442\u043e\u043a\u0435\u043d \u0434\u043b\u044f \u0430\u0443\u0434\u0438\u043e<\/p>\n<\/li>\n<li>\n<p><strong>\u0420\u0435\u0447\u0435\u0432\u0430\u044f \u0433\u043e\u043b\u043e\u0432\u0430<\/strong> (<code>llm_decoder<\/code>) \u2014 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u0432\u044b\u0445\u043e\u0434\u043d\u043e\u0439 \u0441\u043b\u043e\u0439 \u0434\u043b\u044f \u0440\u0435\u0447\u0435\u0432\u044b\u0445 \u0442\u043e\u043a\u0435\u043d\u043e\u0432<\/p>\n<\/li>\n<\/ul>\n<p>llama.cpp \u043d\u0435 \u0437\u043d\u0430\u0435\u0442 \u043e\u0431 \u044d\u0442\u043e\u0439 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0435. \u041e\u043d \u043e\u0436\u0438\u0434\u0430\u0435\u0442 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u0443\u044e \u043c\u043e\u0434\u0435\u043b\u044c \u0441 \u043e\u0434\u043d\u0438\u043c \u0441\u043b\u043e\u0432\u0430\u0440\u0451\u043c \u0438 \u043e\u0434\u043d\u043e\u0439 lm_head.<\/p>\n<hr\/>\n<h3>\u041a\u043e\u043d\u0432\u0435\u0440\u0442\u0435\u0440: \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u044f\u0435\u043c \u0432\u0441\u0451 \u0432 \u043e\u0434\u043d\u0443 \u043e\u0431\u044b\u0447\u043d\u0443\u044e LLM<\/h3>\n<p>\u0427\u0442\u043e\u0431\u044b \u0441\u043a\u043e\u0440\u043c\u0438\u0442\u044c \u043c\u043e\u0434\u0435\u043b\u044c llama.cpp, \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u0435\u0451 \u043a \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u043c\u0443 \u0432\u0438\u0434\u0443. \u0418\u0434\u0435\u044f \u043f\u0440\u043e\u0441\u0442\u0430\u044f: \u0441\u043b\u0438\u0442\u044c \u043e\u0431\u0430 \u044d\u043c\u0431\u0435\u0434\u0434\u0438\u043d\u0433\u0430 \u0432 \u043e\u0434\u0438\u043d \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0441\u043b\u043e\u0432\u0430\u0440\u044c.<\/p>\n<pre><code class=\"python\"># \u041a\u043e\u043d\u043a\u0430\u0442\u0435\u043d\u0438\u0440\u0443\u0435\u043c \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0435 \u0438 \u0440\u0435\u0447\u0435\u0432\u044b\u0435 \u044d\u043c\u0431\u0435\u0434\u0434\u0438\u043d\u0433\u0438input_emb = torch.cat([txt_emb, spk_in], dim=0)  # \u0422\u0435\u043f\u0435\u0440\u044c vocab_size = 151936 + 6561+200 = ~158700# \u0421\u043e\u0431\u0438\u0440\u0430\u0435\u043c \u0435\u0434\u0438\u043d\u0443\u044e lm_headfull_output = torch.zeros((input_emb.shape[0], input_emb.shape[1]))full_output[:151936, :] = txt_emb        # \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u0430\u044f \u0447\u0430\u0441\u0442\u044cfull_output[151936:, :] = spk_out        # \u0440\u0435\u0447\u0435\u0432\u0430\u044f \u0447\u0430\u0441\u0442\u044c<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:87px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u043c <code>config.json<\/code> (\u043d\u043e\u0432\u044b\u0439 <code>vocab_size<\/code>, <code>tie_word_embeddings: false<\/code>) \u0438 \u0440\u0430\u0441\u0448\u0438\u0440\u044f\u0435\u043c <code>vocab.json<\/code>, \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u044f \u0442\u043e\u043a\u0435\u043d\u044b \u0432\u0438\u0434\u0430 <code>&lt;|s_0|&gt;<\/code>, <code>&lt;|s_1|&gt;<\/code>, &#8230; \u0434\u043b\u044f \u0440\u0435\u0447\u0435\u0432\u044b\u0445 \u0442\u043e\u043a\u0435\u043d\u043e\u0432.<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c <code>convert_hf_to_gguf.py<\/code> \u0438\u0437 llama.cpp \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0431\u0435\u0437 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u0438 \u0432\u0438\u0434\u0438\u0442 \u043f\u0440\u043e\u0441\u0442\u043e \u0431\u043e\u043b\u044c\u0448\u043e\u0439 Qwen2.5.<\/p>\n<p>\u0413\u043e\u0442\u043e\u0432\u044b\u0435 \u0441\u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u043c\u043e\u0434\u0435\u043b\u0438 \u043e\u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u043d\u044b \u043d\u0430 HuggingFace: <a href=\"https:\/\/huggingface.co\/Ferraronp\/CosyVoice3-qwen2.5-0.5b-speech-gguf\" rel=\"noopener noreferrer nofollow\">Ferraronp\/CosyVoice3-qwen2.5-0.5b-speech-gguf<\/a><\/p>\n<p>\u0414\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u043a\u0432\u0430\u043d\u0442\u0438\u0437\u0430\u0446\u0438\u0438: Q2_K, Q3_K_S, Q3_K_M, Q3_K_L, Q4_0, Q4_1, Q4_K_S, Q4_K_M, Q5_0, Q5_1, Q5_K_S, Q5_K_M, Q6_K, Q8_0, BF16, F16, F32.<\/p>\n<p>\u041a\u043e\u043d\u0432\u0435\u0440\u0442\u0435\u0440 (Colab-\u043d\u043e\u0443\u0442\u0431\u0443\u043a): <a href=\"https:\/\/github.com\/Ferraronp\/CosyVoice-gguf-converter\" rel=\"noopener noreferrer nofollow\">Ferraronp\/CosyVoice-gguf-converter<\/a><\/p>\n<hr\/>\n<h3>\u0418\u043d\u0444\u0435\u0440\u0435\u043d\u0441: \u043a\u0430\u043a \u043d\u0435 \u0434\u0430\u0442\u044c \u043c\u043e\u0434\u0435\u043b\u0438 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0442\u0435\u043a\u0441\u0442 \u0432\u043c\u0435\u0441\u0442\u043e \u0440\u0435\u0447\u0438<\/h3>\n<p>\u041f\u043e\u0441\u043b\u0435 \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0430\u0446\u0438\u0438 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u0434\u0440\u0443\u0433\u0430\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430. \u041c\u043e\u0434\u0435\u043b\u044c \u0442\u0435\u043f\u0435\u0440\u044c \u0432\u0438\u0434\u0438\u0442 \u043e\u0433\u0440\u043e\u043c\u043d\u044b\u0439 \u0441\u043b\u043e\u0432\u0430\u0440\u044c \u0438\u0437 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0445 \u0438 \u0440\u0435\u0447\u0435\u0432\u044b\u0445 \u0442\u043e\u043a\u0435\u043d\u043e\u0432. \u041d\u0438\u0447\u0442\u043e \u043d\u0435 \u043c\u0435\u0448\u0430\u0435\u0442 \u0435\u0439 \u043d\u0430 \u0432\u044b\u0445\u043e\u0434\u0435 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043e\u0431\u044b\u0447\u043d\u044b\u0439 \u0442\u0435\u043a\u0441\u0442 \u2014 \u0432\u0435\u0434\u044c \u0441 \u0435\u0451 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u044d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0442\u043e\u043a\u0435\u043d\u044b \u0441 \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u043c\u0438 \u0438\u043d\u0434\u0435\u043a\u0441\u0430\u043c\u0438.<\/p>\n<p>\u0420\u0435\u0448\u0435\u043d\u0438\u0435: \u043c\u0430\u0441\u043a\u0438\u0440\u043e\u0432\u043a\u0430 \u043b\u043e\u0433\u0438\u0442\u043e\u0432 \u043f\u0440\u0438 \u0441\u044d\u043c\u043f\u043b\u0438\u043d\u0433\u0435. \u041f\u0435\u0440\u0435\u0434 \u0432\u044b\u0431\u043e\u0440\u043e\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e \u0442\u043e\u043a\u0435\u043d\u0430 \u0431\u0435\u0440\u0451\u043c \u0441\u044b\u0440\u044b\u0435 \u043b\u043e\u0433\u0438\u0442\u044b \u0438\u0437 llama.cpp, \u0441\u0442\u0430\u0432\u0438\u043c <code>-inf<\/code> \u043d\u0430 \u0432\u0441\u0435 \u043f\u043e\u0437\u0438\u0446\u0438\u0438 \u043a\u0440\u043e\u043c\u0435 \u0440\u0435\u0447\u0435\u0432\u044b\u0445 \u0442\u043e\u043a\u0435\u043d\u043e\u0432 \u0438 EOS:<\/p>\n<pre><code class=\"python\">logits = np.array(self.llm_gguf.scores[logit_pos], dtype=np.float32)# \u0420\u0430\u0437\u0440\u0435\u0448\u0430\u0435\u043c \u0442\u043e\u043b\u044c\u043a\u043e \u0440\u0435\u0447\u0435\u0432\u044b\u0435 \u0442\u043e\u043a\u0435\u043d\u044b [151936, 151936+6561) \u0438 EOSvalid = np.full(n_vocab, False)valid[speech_offset : speech_offset + base_speech_size] = Truevalid[eos_token_id] = Truelogits[~valid] = -np.inf# \u0414\u0430\u043b\u044c\u0448\u0435 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 softmax + top-k\/top-p \u0441\u044d\u043c\u043f\u043b\u0438\u043d\u0433probs = np.exp((logits - logits[valid].max()) \/ temperature)probs \/= probs.sum()next_token = np.random.choice(n_vocab, p=probs)<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0412\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0439 <code>sample()<\/code> \u0438\u0437 llama-cpp-python \u0442\u043e\u0436\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u043d\u043e \u0438\u043d\u043e\u0433\u0434\u0430 \u043c\u043e\u0436\u0435\u0442 \u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0439 \u0442\u043e\u043a\u0435\u043d \u2014 \u0432 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043a\u043e\u0434 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u043c\u0430\u0441\u043a\u0438\u0440\u043e\u0432\u043a\u0443.<\/p>\n<hr\/>\n<h3>\u0410 \u043a\u0430\u043a \u043d\u0430\u0441\u0447\u0451\u0442 TRT-LLM?<\/h3>\n<p>\u0421\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0444\u043e\u0440\u043a <a href=\"https:\/\/github.com\/Brakanier\/FastCosyVoice\" rel=\"noopener noreferrer nofollow\">FastCosyVoice<\/a> \u0441 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u043e\u0439 TensorRT-LLM. \u042d\u0442\u043e \u043c\u043e\u0449\u043d\u044b\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442, \u043d\u043e \u043e\u043d \u0442\u0440\u0435\u0431\u0443\u0435\u0442 Docker \u0438 \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0430\u0446\u0438\u044e \u043c\u043e\u0434\u0435\u043b\u0438 \u043f\u043e\u0434 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u0443\u044e GPU. \u0411\u0435\u043d\u0447\u043c\u0430\u0440\u043a\u0438 \u0442\u0430\u043c \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430 RTX 3090 \u0438 RTX 5060ti. \u041d\u0430 \u0441\u043b\u0430\u0431\u044b\u0445 \u043a\u0430\u0440\u0442\u0430\u0445 \u044d\u0442\u043e \u043b\u0438\u0431\u043e \u043d\u0435 \u0437\u0430\u0432\u0435\u0434\u0451\u0442\u0441\u044f, \u043b\u0438\u0431\u043e \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0447\u0430\u0441\u043e\u0432 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438.<\/p>\n<p>llama-cpp-python \u0431\u044d\u043a\u0435\u043d\u0434 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043e\u0434\u043d\u043e\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439:<\/p>\n<pre><code class=\"bash\">pip install llama-cpp-python<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u041d\u0438\u043a\u0430\u043a\u043e\u0433\u043e Docker, \u043d\u0438\u043a\u0430\u043a\u043e\u0433\u043e Triton, \u043d\u0438\u043a\u0430\u043a\u043e\u0439 \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0430\u0446\u0438\u0438 \u043f\u043e\u0434 GPU. \u0420\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043d\u0430 \u0441\u043b\u0430\u0431\u044b\u0445 GPU, \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043d\u0430 CPU. \u0415\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u043d\u0435\u0442 \u0442\u043e\u043f\u043e\u0432\u043e\u0439 \u043a\u0430\u0440\u0442\u044b \u2014 \u044d\u0442\u043e \u0432\u0430\u0448 \u0432\u0430\u0440\u0438\u0430\u043d\u0442.<\/p>\n<hr\/>\n<h3>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b<\/h3>\n<p>\u0422\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043b\u043e\u0441\u044c \u043d\u0430 NVIDIA T4, fp16:<\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<th>\n<p align=\"left\">\u0411\u044d\u043a\u0435\u043d\u0434<\/p>\n<\/th>\n<th>\n<p align=\"left\">\u0421\u0440\u0435\u0434\u043d\u0435\u0435 RTF<\/p>\n<\/th>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">PyTorch fp16 (\u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b)<\/p>\n<\/td>\n<td>\n<p align=\"left\">~1.17<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">llama-cpp-python F16 GGUF<\/p>\n<\/td>\n<td>\n<p align=\"left\">~0.45<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>RTF &lt; 1.0 \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u0447\u0442\u043e \u0441\u0438\u043d\u0442\u0435\u0437 \u0438\u0434\u0451\u0442 \u0431\u044b\u0441\u0442\u0440\u0435\u0435 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u2014 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432 \u0441\u0442\u0440\u0438\u043c\u0438\u043d\u0433\u0435 \u0431\u0435\u0437 \u043d\u0430\u043a\u043e\u043f\u043b\u0435\u043d\u0438\u044f \u043b\u0430\u0433\u0430.<\/p>\n<hr\/>\n<h3>\u041a\u0430\u043a \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c<\/h3>\n<p><strong>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430:<\/strong><\/p>\n<pre><code class=\"bash\">pip install llama-cpp-python<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p><strong>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435:<\/strong><\/p>\n<pre><code class=\"python\">from cosyvoice.cli.cosyvoice import AutoModelcosyvoice = AutoModel(    model_dir='pretrained_models\/Fun-CosyVoice3-0.5B',    load_llama_cpp=True,    gguf_model_path='\/path\/to\/cosyvoice_llm_f16.gguf')# \u0412\u0441\u0435 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u043a\u0430\u043a \u043e\u0431\u044b\u0447\u043d\u043efor output in cosyvoice.inference_zero_shot(text, prompt_text, prompt_wav):    audio = output['tts_speech']<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0421\u043a\u0430\u0447\u0430\u0442\u044c \u0433\u043e\u0442\u043e\u0432\u0443\u044e GGUF \u043c\u043e\u0434\u0435\u043b\u044c: <a href=\"https:\/\/huggingface.co\/Ferraronp\/CosyVoice3-qwen2.5-0.5b-speech-gguf\" rel=\"noopener noreferrer nofollow\">HuggingFace<\/a><\/p>\n<p>\u0424\u043e\u0440\u043a \u0441 llama-cpp-python \u0431\u044d\u043a\u0435\u043d\u0434\u043e\u043c (\u0434\u043b\u044f \u0431\u044b\u0441\u0442\u0440\u043e\u0433\u043e \u0441\u0442\u0430\u0440\u0442\u0430): <a href=\"https:\/\/github.com\/Ferraronp\/CosyVoice\" rel=\"noopener noreferrer nofollow\">Ferraronp\/CosyVoice<\/a><\/p>\n<p>PR \u0432 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u0439 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439: <a href=\"https:\/\/github.com\/FunAudioLLM\/CosyVoice\/pull\/1872\" rel=\"noopener noreferrer nofollow\">FunAudioLLM\/CosyVoice#1872<\/a><\/p>\n<\/div>\n<p>\u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/1027934\/\">https:\/\/habr.com\/ru\/articles\/1027934\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>CosyVoice3 \u2014 \u043e\u0434\u043d\u0430 \u0438\u0437 \u043b\u0443\u0447\u0448\u0438\u0445 open source TTS \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u043f\u0440\u044f\u043c\u043e \u0441\u0435\u0439\u0447\u0430\u0441, \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0434\u043b\u044f \u0440\u0443\u0441\u0441\u043a\u043e\u0433\u043e \u044f\u0437\u044b\u043a\u0430. \u041d\u043e \u0443 \u043d\u0435\u0451 \u0435\u0441\u0442\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430: LLM-\u0447\u0430\u0441\u0442\u044c \u043d\u0430 PyTorch \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u043e \u043d\u0430 \u0441\u043b\u0430\u0431\u044b\u0445 GPU \u0432\u0440\u043e\u0434\u0435 T4. RTF (real-time factor) \u043e\u043a\u043e\u043b\u043e 1.17 \u2014 \u044d\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442 \u0441\u0438\u043d\u0442\u0435\u0437 \u043e\u0434\u043d\u043e\u0439 \u0441\u0435\u043a\u0443\u043d\u0434\u044b \u0430\u0443\u0434\u0438\u043e \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442 \u0431\u043e\u043b\u044c\u0448\u0435 \u0441\u0435\u043a\u0443\u043d\u0434\u044b \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438.\u042f \u0440\u0435\u0448\u0438\u043b \u044d\u0442\u043e \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c, \u0434\u043e\u0431\u0430\u0432\u0438\u0432 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 llama.cpp \u0447\u0435\u0440\u0435\u0437 llama-cpp-python. \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442: RTF \u0443\u043f\u0430\u043b \u0434\u043e ~0.45, \u0442\u043e \u0435\u0441\u0442\u044c \u0443\u0441\u043a\u043e\u0440\u0435\u043d\u0438\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0432 2.6x.\u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043a\u0430\u043a \u044d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u043f\u043e\u0447\u0435\u043c\u0443 \u044d\u0442\u043e \u043d\u0435\u0442\u0440\u0438\u0432\u0438\u0430\u043b\u044c\u043d\u043e, \u0438 \u043a\u0430\u043a \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u0441\u0430\u043c\u043e\u043c\u0443.\u041f\u043e\u0447\u0435\u043c\u0443 CosyVoice LLM \u2014 \u043d\u0435 \u043e\u0431\u044b\u0447\u043d\u0430\u044f LLMCosyVoice3 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 LLM (\u043d\u0430 \u0431\u0430\u0437\u0435 Qwen2.5-0.5B) \u0434\u043b\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0440\u0435\u0447\u0435\u0432\u044b\u0445 \u0442\u043e\u043a\u0435\u043d\u043e\u0432. \u041d\u043e \u044d\u0442\u043e \u043d\u0435 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u0430\u044f \u044f\u0437\u044b\u043a\u043e\u0432\u0430\u044f \u043c\u043e\u0434\u0435\u043b\u044c \u2014 \u0443 \u043d\u0435\u0451 \u0434\u0432\u0435 \u0433\u043e\u043b\u043e\u0432\u044b \u0438 \u0434\u0432\u0430 \u043d\u0430\u0431\u043e\u0440\u0430 \u044d\u043c\u0431\u0435\u0434\u0434\u0438\u043d\u0433\u043e\u0432:\u0422\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0435 \u044d\u043c\u0431\u0435\u0434\u0434\u0438\u043d\u0433\u0438 (embed_tokens) \u2014 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 \u0441\u043b\u043e\u0432\u0430\u0440\u044c Qwen, ~151936 \u0442\u043e\u043a\u0435\u043d\u043e\u0432\u0420\u0435\u0447\u0435\u0432\u044b\u0435 \u044d\u043c\u0431\u0435\u0434\u0434\u0438\u043d\u0433\u0438 (speech_embedding) \u2014 6561 \u0442\u043e\u043a\u0435\u043d \u0434\u043b\u044f \u0430\u0443\u0434\u0438\u043e\u0420\u0435\u0447\u0435\u0432\u0430\u044f \u0433\u043e\u043b\u043e\u0432\u0430 (llm_decoder) \u2014 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u0432\u044b\u0445\u043e\u0434\u043d\u043e\u0439 \u0441\u043b\u043e\u0439 \u0434\u043b\u044f \u0440\u0435\u0447\u0435\u0432\u044b\u0445 \u0442\u043e\u043a\u0435\u043d\u043e\u0432llama.cpp \u043d\u0435 \u0437\u043d\u0430\u0435\u0442 \u043e\u0431 \u044d\u0442\u043e\u0439 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0435. \u041e\u043d \u043e\u0436\u0438\u0434\u0430\u0435\u0442 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u0443\u044e \u043c\u043e\u0434\u0435\u043b\u044c \u0441 \u043e\u0434\u043d\u0438\u043c \u0441\u043b\u043e\u0432\u0430\u0440\u0451\u043c \u0438 \u043e\u0434\u043d\u043e\u0439 lm_head.\u041a\u043e\u043d\u0432\u0435\u0440\u0442\u0435\u0440: \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u044f\u0435\u043c \u0432\u0441\u0451 \u0432 \u043e\u0434\u043d\u0443 \u043e\u0431\u044b\u0447\u043d\u0443\u044e LLM\u0427\u0442\u043e\u0431\u044b \u0441\u043a\u043e\u0440\u043c\u0438\u0442\u044c \u043c\u043e\u0434\u0435\u043b\u044c llama.cpp, \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u0435\u0451 \u043a \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u043c\u0443 \u0432\u0438\u0434\u0443. \u0418\u0434\u0435\u044f \u043f\u0440\u043e\u0441\u0442\u0430\u044f: \u0441\u043b\u0438\u0442\u044c \u043e\u0431\u0430 \u044d\u043c\u0431\u0435\u0434\u0434\u0438\u043d\u0433\u0430 \u0432 \u043e\u0434\u0438\u043d \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0441\u043b\u043e\u0432\u0430\u0440\u044c.# \u041a\u043e\u043d\u043a\u0430\u0442\u0435\u043d\u0438\u0440\u0443\u0435\u043c \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0435 \u0438 \u0440\u0435\u0447\u0435\u0432\u044b\u0435 \u044d\u043c\u0431\u0435\u0434\u0434\u0438\u043d\u0433\u0438input_emb = torch.cat([txt_emb, spk_in], dim=0)  # \u0422\u0435\u043f\u0435\u0440\u044c vocab_size = 151936 + 6561+200 = ~158700# \u0421\u043e\u0431\u0438\u0440\u0430\u0435\u043c \u0435\u0434\u0438\u043d\u0443\u044e lm_headfull_output = torch.zeros((input_emb.shape[0], input_emb.shape[1]))full_output[:151936, :] = txt_emb        # \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u0430\u044f \u0447\u0430\u0441\u0442\u044cfull_output[151936:, :] = spk_out        # \u0440\u0435\u0447\u0435\u0432\u0430\u044f \u0447\u0430\u0441\u0442\u044c\u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u043c config.json (\u043d\u043e\u0432\u044b\u0439 vocab_size, tie_word_embeddings: false) \u0438 \u0440\u0430\u0441\u0448\u0438\u0440\u044f\u0435\u043c vocab.json, \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u044f \u0442\u043e\u043a\u0435\u043d\u044b \u0432\u0438\u0434\u0430 &lt;|s_0|&gt;, &lt;|s_1|&gt;, &#8230; \u0434\u043b\u044f \u0440\u0435\u0447\u0435\u0432\u044b\u0445 \u0442\u043e\u043a\u0435\u043d\u043e\u0432.\u0422\u0435\u043f\u0435\u0440\u044c convert_hf_to_gguf.py \u0438\u0437 llama.cpp \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0431\u0435\u0437 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u0438 \u0432\u0438\u0434\u0438\u0442 \u043f\u0440\u043e\u0441\u0442\u043e \u0431\u043e\u043b\u044c\u0448\u043e\u0439 Qwen2.5.\u0413\u043e\u0442\u043e\u0432\u044b\u0435 \u0441\u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u043c\u043e\u0434\u0435\u043b\u0438 \u043e\u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u043d\u044b \u043d\u0430 HuggingFace: Ferraronp\/CosyVoice3-qwen2.5-0.5b-speech-gguf\u0414\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u043a\u0432\u0430\u043d\u0442\u0438\u0437\u0430\u0446\u0438\u0438: Q2_K, Q3_K_S, Q3_K_M, Q3_K_L, Q4_0, Q4_1, Q4_K_S, Q4_K_M, Q5_0, Q5_1, Q5_K_S, Q5_K_M, Q6_K, Q8_0, BF16, F16, F32.\u041a\u043e\u043d\u0432\u0435\u0440\u0442\u0435\u0440 (Colab-\u043d\u043e\u0443\u0442\u0431\u0443\u043a): Ferraronp\/CosyVoice-gguf-converter\u0418\u043d\u0444\u0435\u0440\u0435\u043d\u0441: \u043a\u0430\u043a \u043d\u0435 \u0434\u0430\u0442\u044c \u043c\u043e\u0434\u0435\u043b\u0438 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0442\u0435\u043a\u0441\u0442 \u0432\u043c\u0435\u0441\u0442\u043e \u0440\u0435\u0447\u0438\u041f\u043e\u0441\u043b\u0435 \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0430\u0446\u0438\u0438 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u0434\u0440\u0443\u0433\u0430\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430. \u041c\u043e\u0434\u0435\u043b\u044c \u0442\u0435\u043f\u0435\u0440\u044c \u0432\u0438\u0434\u0438\u0442 \u043e\u0433\u0440\u043e\u043c\u043d\u044b\u0439 \u0441\u043b\u043e\u0432\u0430\u0440\u044c \u0438\u0437 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0445 \u0438 \u0440\u0435\u0447\u0435\u0432\u044b\u0445 \u0442\u043e\u043a\u0435\u043d\u043e\u0432. \u041d\u0438\u0447\u0442\u043e \u043d\u0435 \u043c\u0435\u0448\u0430\u0435\u0442 \u0435\u0439 \u043d\u0430 \u0432\u044b\u0445\u043e\u0434\u0435 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043e\u0431\u044b\u0447\u043d\u044b\u0439 \u0442\u0435\u043a\u0441\u0442 \u2014 \u0432\u0435\u0434\u044c \u0441 \u0435\u0451 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u044d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0442\u043e\u043a\u0435\u043d\u044b \u0441 \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u043c\u0438 \u0438\u043d\u0434\u0435\u043a\u0441\u0430\u043c\u0438.\u0420\u0435\u0448\u0435\u043d\u0438\u0435: \u043c\u0430\u0441\u043a\u0438\u0440\u043e\u0432\u043a\u0430 \u043b\u043e\u0433\u0438\u0442\u043e\u0432 \u043f\u0440\u0438 \u0441\u044d\u043c\u043f\u043b\u0438\u043d\u0433\u0435. \u041f\u0435\u0440\u0435\u0434 \u0432\u044b\u0431\u043e\u0440\u043e\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e \u0442\u043e\u043a\u0435\u043d\u0430 \u0431\u0435\u0440\u0451\u043c \u0441\u044b\u0440\u044b\u0435 \u043b\u043e\u0433\u0438\u0442\u044b \u0438\u0437 llama.cpp, \u0441\u0442\u0430\u0432\u0438\u043c -inf \u043d\u0430 \u0432\u0441\u0435 \u043f\u043e\u0437\u0438\u0446\u0438\u0438 \u043a\u0440\u043e\u043c\u0435 \u0440\u0435\u0447\u0435\u0432\u044b\u0445 \u0442\u043e\u043a\u0435\u043d\u043e\u0432 \u0438 EOS:logits = np.array(self.llm_gguf.scores[logit_pos], dtype=np.float32)# \u0420\u0430\u0437\u0440\u0435\u0448\u0430\u0435\u043c \u0442\u043e\u043b\u044c\u043a\u043e \u0440\u0435\u0447\u0435\u0432\u044b\u0435 \u0442\u043e\u043a\u0435\u043d\u044b [151936, 151936+6561) \u0438 EOSvalid = np.full(n_vocab, False)valid[speech_offset : speech_offset + base_speech_size] = Truevalid[eos_token_id] = Truelogits[~valid] = -np.inf# \u0414\u0430\u043b\u044c\u0448\u0435 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 softmax + top-k\/top-p \u0441\u044d\u043c\u043f\u043b\u0438\u043d\u0433probs = np.exp((logits &#8212; logits[valid].max()) \/ temperature)probs \/= probs.sum()next_token = np.random.choice(n_vocab, p=probs)\u0412\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0439 sample() \u0438\u0437 llama-cpp-python \u0442\u043e\u0436\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u043d\u043e \u0438\u043d\u043e\u0433\u0434\u0430 \u043c\u043e\u0436\u0435\u0442 \u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0439 \u0442\u043e\u043a\u0435\u043d \u2014 \u0432 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043a\u043e\u0434 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u043c\u0430\u0441\u043a\u0438\u0440\u043e\u0432\u043a\u0443.\u0410 \u043a\u0430\u043a \u043d\u0430\u0441\u0447\u0451\u0442 TRT-LLM?\u0421\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0444\u043e\u0440\u043a FastCosyVoice \u0441 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u043e\u0439 TensorRT-LLM. \u042d\u0442\u043e \u043c\u043e\u0449\u043d\u044b\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442, \u043d\u043e \u043e\u043d \u0442\u0440\u0435\u0431\u0443\u0435\u0442 Docker \u0438 \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0430\u0446\u0438\u044e \u043c\u043e\u0434\u0435\u043b\u0438 \u043f\u043e\u0434 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u0443\u044e GPU. \u0411\u0435\u043d\u0447\u043c\u0430\u0440\u043a\u0438 \u0442\u0430\u043c \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430 RTX 3090 \u0438 RTX 5060ti. \u041d\u0430 \u0441\u043b\u0430\u0431\u044b\u0445 \u043a\u0430\u0440\u0442\u0430\u0445 \u044d\u0442\u043e \u043b\u0438\u0431\u043e \u043d\u0435 \u0437\u0430\u0432\u0435\u0434\u0451\u0442\u0441\u044f, \u043b\u0438\u0431\u043e \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0447\u0430\u0441\u043e\u0432 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438.llama-cpp-python \u0431\u044d\u043a\u0435\u043d\u0434 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043e\u0434\u043d\u043e\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439:pip install llama-cpp-python\u041d\u0438\u043a\u0430\u043a\u043e\u0433\u043e Docker, \u043d\u0438\u043a\u0430\u043a\u043e\u0433\u043e Triton, \u043d\u0438\u043a\u0430\u043a\u043e\u0439 \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0430\u0446\u0438\u0438 \u043f\u043e\u0434 GPU. \u0420\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043d\u0430 \u0441\u043b\u0430\u0431\u044b\u0445 GPU, \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043d\u0430 CPU. \u0415\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u043d\u0435\u0442 \u0442\u043e\u043f\u043e\u0432\u043e\u0439 \u043a\u0430\u0440\u0442\u044b \u2014 \u044d\u0442\u043e \u0432\u0430\u0448 \u0432\u0430\u0440\u0438\u0430\u043d\u0442.\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b\u0422\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043b\u043e\u0441\u044c \u043d\u0430 NVIDIA T4, fp16:\u0411\u044d\u043a\u0435\u043d\u0434\u0421\u0440\u0435\u0434\u043d\u0435\u0435 RTFPyTorch fp16 (\u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b)~1.17llama-cpp-python F16 GGUF~0.45RTF &lt; 1.0 \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u0447\u0442\u043e \u0441\u0438\u043d\u0442\u0435\u0437 \u0438\u0434\u0451\u0442 \u0431\u044b\u0441\u0442\u0440\u0435\u0435 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u2014 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432 \u0441\u0442\u0440\u0438\u043c\u0438\u043d\u0433\u0435 \u0431\u0435\u0437 \u043d\u0430\u043a\u043e\u043f\u043b\u0435\u043d\u0438\u044f \u043b\u0430\u0433\u0430.\u041a\u0430\u043a \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430:pip install llama-cpp-python\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435:from cosyvoice.cli.cosyvoice import AutoModelcosyvoice = AutoModel(    model_dir=&#8217;pretrained_models\/Fun-CosyVoice3-0.5B&#8217;,    load_llama_cpp=True,    gguf_model_path=&#8217;\/path\/to\/cosyvoice_llm_f16.gguf&#8217;)# \u0412\u0441\u0435 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u043a\u0430\u043a \u043e\u0431\u044b\u0447\u043d\u043efor output in cosyvoice.inference_zero_shot(text, prompt_text, prompt_wav):    audio = output[&#8216;tts_speech&#8217;]\u0421\u043a\u0430\u0447\u0430\u0442\u044c \u0433\u043e\u0442\u043e\u0432\u0443\u044e GGUF \u043c\u043e\u0434\u0435\u043b\u044c: HuggingFace\u0424\u043e\u0440\u043a \u0441 llama-cpp-python \u0431\u044d\u043a\u0435\u043d\u0434\u043e\u043c (\u0434\u043b\u044f \u0431\u044b\u0441\u0442\u0440\u043e\u0433\u043e \u0441\u0442\u0430\u0440\u0442\u0430): Ferraronp\/CosyVoicePR \u0432 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u0439 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439: FunAudioLLM\/CosyVoice#1872\u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 https:\/\/habr.com\/ru\/articles\/1027934\/<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-477395","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/477395","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=477395"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/477395\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=477395"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=477395"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=477395"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}