[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"similar-zai-org--GLM-TTS":3,"tool-zai-org--GLM-TTS":61},[4,18,26,36,44,53],{"id":5,"name":6,"github_repo":7,"description_zh":8,"stars":9,"difficulty_score":10,"last_commit_at":11,"category_tags":12,"status":17},4358,"openclaw","openclaw\u002Fopenclaw","OpenClaw 是一款专为个人打造的本地化 AI 助手，旨在让你在自己的设备上拥有完全可控的智能伙伴。它打破了传统 AI 助手局限于特定网页或应用的束缚，能够直接接入你日常使用的各类通讯渠道，包括微信、WhatsApp、Telegram、Discord、iMessage 等数十种平台。无论你在哪个聊天软件中发送消息，OpenClaw 都能即时响应，甚至支持在 macOS、iOS 和 Android 设备上进行语音交互，并提供实时的画布渲染功能供你操控。\n\n这款工具主要解决了用户对数据隐私、响应速度以及“始终在线”体验的需求。通过将 AI 部署在本地，用户无需依赖云端服务即可享受快速、私密的智能辅助，真正实现了“你的数据，你做主”。其独特的技术亮点在于强大的网关架构，将控制平面与核心助手分离，确保跨平台通信的流畅性与扩展性。\n\nOpenClaw 非常适合希望构建个性化工作流的技术爱好者、开发者，以及注重隐私保护且不愿被单一生态绑定的普通用户。只要具备基础的终端操作能力（支持 macOS、Linux 及 Windows WSL2），即可通过简单的命令行引导完成部署。如果你渴望拥有一个懂你",349277,3,"2026-04-06T06:32:30",[13,14,15,16],"Agent","开发框架","图像","数据工具","ready",{"id":19,"name":20,"github_repo":21,"description_zh":22,"stars":23,"difficulty_score":10,"last_commit_at":24,"category_tags":25,"status":17},3808,"stable-diffusion-webui","AUTOMATIC1111\u002Fstable-diffusion-webui","stable-diffusion-webui 是一个基于 Gradio 构建的网页版操作界面，旨在让用户能够轻松地在本地运行和使用强大的 Stable Diffusion 图像生成模型。它解决了原始模型依赖命令行、操作门槛高且功能分散的痛点，将复杂的 AI 绘图流程整合进一个直观易用的图形化平台。\n\n无论是希望快速上手的普通创作者、需要精细控制画面细节的设计师，还是想要深入探索模型潜力的开发者与研究人员，都能从中获益。其核心亮点在于极高的功能丰富度：不仅支持文生图、图生图、局部重绘（Inpainting）和外绘（Outpainting）等基础模式，还独创了注意力机制调整、提示词矩阵、负向提示词以及“高清修复”等高级功能。此外，它内置了 GFPGAN 和 CodeFormer 等人脸修复工具，支持多种神经网络放大算法，并允许用户通过插件系统无限扩展能力。即使是显存有限的设备，stable-diffusion-webui 也提供了相应的优化选项，让高质量的 AI 艺术创作变得触手可及。",162132,"2026-04-05T11:01:52",[14,15,13],{"id":27,"name":28,"github_repo":29,"description_zh":30,"stars":31,"difficulty_score":32,"last_commit_at":33,"category_tags":34,"status":17},1381,"everything-claude-code","affaan-m\u002Feverything-claude-code","everything-claude-code 是一套专为 AI 编程助手（如 Claude Code、Codex、Cursor 等）打造的高性能优化系统。它不仅仅是一组配置文件，而是一个经过长期实战打磨的完整框架，旨在解决 AI 代理在实际开发中面临的效率低下、记忆丢失、安全隐患及缺乏持续学习能力等核心痛点。\n\n通过引入技能模块化、直觉增强、记忆持久化机制以及内置的安全扫描功能，everything-claude-code 能显著提升 AI 在复杂任务中的表现，帮助开发者构建更稳定、更智能的生产级 AI 代理。其独特的“研究优先”开发理念和针对 Token 消耗的优化策略，使得模型响应更快、成本更低，同时有效防御潜在的攻击向量。\n\n这套工具特别适合软件开发者、AI 研究人员以及希望深度定制 AI 工作流的技术团队使用。无论您是在构建大型代码库，还是需要 AI 协助进行安全审计与自动化测试，everything-claude-code 都能提供强大的底层支持。作为一个曾荣获 Anthropic 黑客大奖的开源项目，它融合了多语言支持与丰富的实战钩子（hooks），让 AI 真正成长为懂上",145895,2,"2026-04-08T11:32:59",[14,13,35],"语言模型",{"id":37,"name":38,"github_repo":39,"description_zh":40,"stars":41,"difficulty_score":32,"last_commit_at":42,"category_tags":43,"status":17},2271,"ComfyUI","Comfy-Org\u002FComfyUI","ComfyUI 是一款功能强大且高度模块化的视觉 AI 引擎，专为设计和执行复杂的 Stable Diffusion 图像生成流程而打造。它摒弃了传统的代码编写模式，采用直观的节点式流程图界面，让用户通过连接不同的功能模块即可构建个性化的生成管线。\n\n这一设计巧妙解决了高级 AI 绘图工作流配置复杂、灵活性不足的痛点。用户无需具备编程背景，也能自由组合模型、调整参数并实时预览效果，轻松实现从基础文生图到多步骤高清修复等各类复杂任务。ComfyUI 拥有极佳的兼容性，不仅支持 Windows、macOS 和 Linux 全平台，还广泛适配 NVIDIA、AMD、Intel 及苹果 Silicon 等多种硬件架构，并率先支持 SDXL、Flux、SD3 等前沿模型。\n\n无论是希望深入探索算法潜力的研究人员和开发者，还是追求极致创作自由度的设计师与资深 AI 绘画爱好者，ComfyUI 都能提供强大的支持。其独特的模块化架构允许社区不断扩展新功能，使其成为当前最灵活、生态最丰富的开源扩散模型工具之一，帮助用户将创意高效转化为现实。",108111,"2026-04-08T11:23:26",[14,15,13],{"id":45,"name":46,"github_repo":47,"description_zh":48,"stars":49,"difficulty_score":32,"last_commit_at":50,"category_tags":51,"status":17},4721,"markitdown","microsoft\u002Fmarkitdown","MarkItDown 是一款由微软 AutoGen 团队打造的轻量级 Python 工具，专为将各类文件高效转换为 Markdown 格式而设计。它支持 PDF、Word、Excel、PPT、图片（含 OCR）、音频（含语音转录）、HTML 乃至 YouTube 链接等多种格式的解析，能够精准提取文档中的标题、列表、表格和链接等关键结构信息。\n\n在人工智能应用日益普及的今天，大语言模型（LLM）虽擅长处理文本，却难以直接读取复杂的二进制办公文档。MarkItDown 恰好解决了这一痛点，它将非结构化或半结构化的文件转化为模型“原生理解”且 Token 效率极高的 Markdown 格式，成为连接本地文件与 AI 分析 pipeline 的理想桥梁。此外，它还提供了 MCP（模型上下文协议）服务器，可无缝集成到 Claude Desktop 等 LLM 应用中。\n\n这款工具特别适合开发者、数据科学家及 AI 研究人员使用，尤其是那些需要构建文档检索增强生成（RAG）系统、进行批量文本分析或希望让 AI 助手直接“阅读”本地文件的用户。虽然生成的内容也具备一定可读性，但其核心优势在于为机器",93400,"2026-04-06T19:52:38",[52,14],"插件",{"id":54,"name":55,"github_repo":56,"description_zh":57,"stars":58,"difficulty_score":10,"last_commit_at":59,"category_tags":60,"status":17},4487,"LLMs-from-scratch","rasbt\u002FLLMs-from-scratch","LLMs-from-scratch 是一个基于 PyTorch 的开源教育项目，旨在引导用户从零开始一步步构建一个类似 ChatGPT 的大型语言模型（LLM）。它不仅是同名技术著作的官方代码库，更提供了一套完整的实践方案，涵盖模型开发、预训练及微调的全过程。\n\n该项目主要解决了大模型领域“黑盒化”的学习痛点。许多开发者虽能调用现成模型，却难以深入理解其内部架构与训练机制。通过亲手编写每一行核心代码，用户能够透彻掌握 Transformer 架构、注意力机制等关键原理，从而真正理解大模型是如何“思考”的。此外，项目还包含了加载大型预训练权重进行微调的代码，帮助用户将理论知识延伸至实际应用。\n\nLLMs-from-scratch 特别适合希望深入底层原理的 AI 开发者、研究人员以及计算机专业的学生。对于不满足于仅使用 API，而是渴望探究模型构建细节的技术人员而言，这是极佳的学习资源。其独特的技术亮点在于“循序渐进”的教学设计：将复杂的系统工程拆解为清晰的步骤，配合详细的图表与示例，让构建一个虽小但功能完备的大模型变得触手可及。无论你是想夯实理论基础，还是为未来研发更大规模的模型做准备",90106,"2026-04-06T11:19:32",[35,15,13,14],{"id":62,"github_repo":63,"name":64,"description_en":65,"description_zh":66,"ai_summary_zh":66,"readme_en":67,"readme_zh":68,"quickstart_zh":69,"use_case_zh":70,"hero_image_url":71,"owner_login":72,"owner_name":73,"owner_avatar_url":74,"owner_bio":75,"owner_company":76,"owner_location":76,"owner_email":76,"owner_twitter":77,"owner_website":78,"owner_url":79,"languages":80,"stars":89,"forks":90,"last_commit_at":91,"license":92,"difficulty_score":10,"env_os":93,"env_gpu":94,"env_ram":93,"env_deps":95,"category_tags":104,"github_topics":106,"view_count":32,"oss_zip_url":76,"oss_zip_packed_at":76,"status":17,"created_at":110,"updated_at":111,"faqs":112,"releases":148},5517,"zai-org\u002FGLM-TTS","GLM-TTS","GLM-TTS: Controllable & Emotion-Expressive Zero-shot TTS with Multi-Reward Reinforcement Learning","GLM-TTS 是一款基于大语言模型的高质量语音合成系统，旨在让机器说话不仅清晰自然，更能充满情感与表现力。它主要解决了传统语音合成声音机械、缺乏情绪感染力以及难以快速模仿特定人声的痛点。通过独特的“多奖励强化学习”框架，GLM-TTS 能够精准控制语调与情感，生成媲美商业系统的生动语音。\n\n该工具的核心亮点在于其强大的零样本语音克隆能力，用户仅需提供 3 到 10 秒的参考音频，即可复刻任意说话人的音色。此外，它支持实时流式推理，非常适合需要低延迟互动的场景，并具备优秀的中英文混合播报及音素级建模能力。系统采用两阶段架构，先由大模型生成语音令牌序列，再通过流匹配模型转化为高保真音频波形。\n\nGLM-TTS 非常适合作为开发者和研究人员构建智能客服、有声读物或虚拟数字人项目的底层引擎；同时，其提供的交互式 Web 界面也让设计师和普通用户能够轻松体验并定制个性化的语音内容。无论是追求技术突破的研究者，还是希望为作品增添情感色彩的创作者，都能从中获得高效、灵活的语音合成解决方案。","# GLM-TTS: Controllable & Emotion-Expressive Zero-shot TTS with Multi-Reward Reinforcement Learning\n\n[中文阅读](README_zh.md)\n\n\u003Cdiv align=\"center\">\n\u003Cimg src=assets\u002Fimages\u002Flogo.svg  width=\"50%\"\u002F>\n\u003C\u002Fdiv>\n\n\u003Cp align=\"center\">\n    \u003Ca href=\"https:\u002F\u002Farxiv.org\u002Fabs\u002F2512.14291\" target=\"_blank\">📜 Paper\u003C\u002Fa>\n    &nbsp;&nbsp;|&nbsp;&nbsp;\n    \u003Ca href=\"https:\u002F\u002Fhuggingface.co\u002Fzai-org\u002FGLM-TTS\" target=\"_blank\">🤗 HuggingFace\u003C\u002Fa>\n    &nbsp;&nbsp;|&nbsp;&nbsp;\n    \u003Ca href=\"https:\u002F\u002Fmodelscope.cn\u002Fmodels\u002FZhipuAI\u002FGLM-TTS\" target=\"_blank\">🤖 ModelScope\u003C\u002Fa>\n    &nbsp;&nbsp;|&nbsp;&nbsp;\n    \u003Ca href=\"https:\u002F\u002Faudio.z.ai\u002F\" target=\"_blank\"> 🛠️Audio.Z.AI\u003C\u002Fa>\n\u003C\u002Fp>\n\n## Model Introduction\nGLM-TTS is a high-quality text-to-speech (TTS) synthesis system based on large language models, supporting zero-shot voice cloning and streaming inference. This system adopts a two-stage architecture: first, it uses LLM to generate speech token sequences, then uses Flow model to convert tokens into high-quality audio waveforms. By introducing a Multi-Reward Reinforcement Learning framework, GLM-TTS can generate more expressive and emotional speech, significantly improving the expressiveness of traditional TTS systems.\n\n## News & Updates\n\n- **[2025.12.11]** 🎉 The project is officially open-sourced, featuring inference scripts and a series of model weights.\n- **[2025.12.17]** GLM-TTS Technical Report is available on arXiv: [2512.14291](https:\u002F\u002Farxiv.org\u002Fabs\u002F2512.14291).\n- **[Coming Soon]** 2D Vocos vocoder update in progress.\n- **[Coming Soon]** Model Weights Optimized via Reinforcement Learning\n\n## Features\n\n- **Zero-shot Voice Cloning**: Clone any speaker's voice with just 3-10 seconds of prompt audio\n- **RL-enhanced Emotion Control**: Achieve more natural emotional expression and prosody control through multi-reward reinforcement learning framework\n- **Streaming Inference**: Support real-time streaming audio generation, suitable for interactive applications\n- **High-quality Synthesis**: Generate natural and expressive speech with quality comparable to commercial systems\n- **Multi-language Support**: Primarily supports Chinese, while also supporting English mixed text\n- **Phoneme-level Modeling**: Support phoneme-level text-to-speech conversion\n- **Flexible Inference Methods**: Support multiple sampling strategies and inference modes\n\n## Quick Start\n\n### Environment Setup\n\nEnsure you use Python 3.10 - Python 3.12 versions.\n\n```bash\n# Clone repository\ngit clone https:\u002F\u002Fgithub.com\u002Fzai-org\u002FGLM-TTS.git\ncd GLM-TTS\n\n# Install dependencies\npip install -r requirements.txt\n\n# Install reinforcement learning related dependencies (optional)\ncd grpo\u002Fmodules\ngit clone https:\u002F\u002Fgithub.com\u002Fs3prl\u002Fs3prl\ngit clone https:\u002F\u002Fgithub.com\u002Fomine-me\u002FLaughterSegmentation\n# Download wavlm_large_finetune.pth and place it in grpo\u002Fckpt directory\n```\n\n### Download Pre-trained Models\n\nWe support downloading the complete model weights (including Tokenizer, LLM, Flow, Vocoder, and Frontend) from HuggingFace or ModelScope.\n\n```bash\n# Create model directory\nmkdir -p ckpt\n\n# Option 1: Download from HuggingFace\npip install -U huggingface_hub\nhuggingface-cli download zai-org\u002FGLM-TTS --local-dir ckpt\n\n# Option 2: Download from ModelScope\npip install -U modelscope\nmodelscope download --model ZhipuAI\u002FGLM-TTS --local_dir ckpt\n```\n\n### Running Inference Demo\n\n#### Command Line Inference\n\n```bash\npython glmtts_inference.py \\\n    --data=example_zh \\\n    --exp_name=_test \\\n    --use_cache \\\n    # --phoneme # Add this flag to enable phoneme capabilities.\n```\n\n#### Shell Script Inference\n\n```bash\nbash glmtts_inference.sh\n```\n\n#### Interactive Web Interface\n\n```bash\npython -m tools.gradio_app\n```\n\n## System Architecture\n\n### Overview\n\n\nGLM-TTS adopts a two-stage design: in the first stage, a large language model (LLM) based on Llama architecture converts input text into speech token sequences; in the second stage, the Flow Matching model converts these token sequences into high-quality mel-spectrogram, and finally generates audio waveforms through a vocoder. The system supports zero-shot voice cloning by extracting speaker features from prompt audio without fine-tuning for specific speakers.\n\n\u003Cdiv align=\"center\">\n  \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fzai-org_GLM-TTS_readme_82e07b36001c.png\" width=\"50%\" alt=\"GLM-TTS Architecture\" title=\"GLM-TTS Architecture\">\n\u003C\u002Fdiv>\n\n### Fine-grained Pronunciation Control (Phoneme-in)\n\nFor scenarios demanding high pronunciation accuracy, such as educational assessments and audiobooks, GLM-TTS introduces the **Phoneme-in** mechanism to address automatic pronunciation ambiguity in polyphones (e.g., \"行\" which can be read as *xíng* or *háng*) and rare characters. This mechanism supports **\"Hybrid Phoneme + Text\"** input, enabling precise, targeted control over specific vocabulary pronunciation.\n\n- **Hybrid Training**\n  During training, random G2P (Grapheme-to-Phoneme) conversion is applied to parts of the text. This strategy compels the model to adapt to hybrid input sequences, preserving its ability to understand pure text while enhancing generalization for phoneme inputs.\n\n- **Targeted Inference**\n  Inference follows a `G2P -> Table Lookup Replacement -> Hybrid Input` workflow:\n  1. **Global Conversion**: Obtain the complete phoneme sequence for the input text.\n  2. **Dynamic Replacement**: Using a \"Dynamic Controllable Dictionary,\" automatically identify polyphones or rare characters and replace them with specified target phonemes.\n  3. **Hybrid Generation**: Feed the combination of replaced phonemes and original text into GLM-TTS as a hybrid input. This ensures precise pronunciation control for specific words while maintaining natural prosody.\n\n\n### RL Alignment\n\n\u003Cdiv align=\"center\">\n  \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fzai-org_GLM-TTS_readme_fe248936c35a.png\" width=\"70%\" alt=\"GLM-TTS RL\" title=\"GLM-TTS RL\">\n\u003C\u002Fdiv>\n\nTo address the issue of flat emotional expression in traditional TTS, we introduce a multi-reward reinforcement learning framework. This framework comprehensively evaluates generated speech through multiple reward functions (including similarity reward, CER reward, emotion reward, laughter reward, etc.) and uses the GRPO (Group Relative Policy Optimization) algorithm to optimize the LLM's generation strategy. Specifically:\n\n1. **Multi-reward Design**: The system designs various reward functions to evaluate the quality of generated speech from different dimensions, including sound quality, similarity, emotional expression, etc.\n2. **Reward Server**: Computes multiple reward functions through a distributed reward server, supporting parallel processing\n3. **Policy Optimization**: Uses GRPO algorithm to optimize the LLM's generation strategy based on reward signals, enhancing the emotional expressiveness of speech\n4. **Token-level Rewards**: Supports fine-grained token-level reward allocation, providing more precise optimization signals\n\nThrough RL optimization, GLM-TTS_RL reduces the CER metric from 1.03 to 0.89 compared to the base model, while maintaining high similarity, achieving better sound quality and expressiveness.\n\n## Core Components & Implementation\n\n### LLM Backend\n- **File Location**: [`llm\u002Fglmtts.py`](llm\u002Fglmtts.py)\n- **Function**: Text-to-speech model based on Llama architecture, responsible for converting input text into speech token sequences\n- **Supported Modes**: Pretrained (PRETRAIN), Fine-tuning (SFT), and LoRA modes\n\n### Flow Matching\n- **File Location**: [`flow\u002F`](flow\u002F) directory\n- **Core Files**: \n  - [`dit.py`](flow\u002Fdit.py): Diffusion Transformer implementation, supporting conditional generation\n  - [`flow.py`](flow\u002Fflow.py): Streaming inference support, implementing real-time audio generation\n- **Function**: Converts token sequences generated by LLM into high-quality mel-spectrogram\n\n### Frontend\n- **File Location**: [`cosyvoice\u002Fcli\u002Ffrontend.py`](cosyvoice\u002Fcli\u002Ffrontend.py)\n- **Function**: Preprocessing of text and speech, including text normalization, phoneme conversion, speech token extraction, and speaker embedding extraction\n- **Features**: Supports Chinese and English mixed text processing\n\n### Reinforcement Learning Module\n- **File Location**: [`grpo\u002F`](grpo\u002F) directory\n- **Core Files**:\n  - [`grpo_utils.py`](grpo\u002Fgrpo_utils.py): GRPO algorithm implementation and batch inference\n  - [`reward_func.py`](grpo\u002Freward_func.py): Multi-reward function implementation\n  - [`reward_server.py`](grpo\u002Freward_server.py): Distributed reward server\n- **Function**: Optimizes the emotional expressiveness of the TTS system through multi-reward reinforcement learning\n\n## Evaluation Results\n\nEvaluated on `seed-tts-eval zh testset`. To maintain consistency with the original evaluation, inference was performed without the `--phoneme` flag.\n\n**CER**: Character Error Rate (lower is better $\\downarrow$) | **SIM**: Similarity (higher is better $\\uparrow$)\n\n| Model | CER $\\downarrow$ | SIM $\\uparrow$ | Open-source |\n| :--- | :---: | :---: | :---: |\n| MegaTTS3 | 1.52 | 79.0 | 🔒 No |\n| DiTAR | 1.02 | 75.3 | 🔒 No |\n| CosyVoice3 | 1.12 | 78.1 | 🔒 No |\n| Seed-TTS | 1.12 | **79.6** | 🔒 No |\n| MiniMax | **0.83** | 78.3 | 🔒 No |\n| CosyVoice2 | 1.38 | 75.7 | 👐 Yes |\n| F5-TTS | 1.53 | 76.0 | 👐 Yes |\n| FireRedTTS-2 | 1.14 | 73.6 | 👐 Yes |\n| IndexTTS2 | 1.03 | 76.5 | 👐 Yes |\n| VibeVoice | 1.16 | 74.4 | 👐 Yes |\n| HiggsAudio-v2 | 1.50 | 74.0 | 👐 Yes |\n| VoxCPM | 0.93 | 77.2 | 👐 Yes |\n| **GLM-TTS (Ours)** | 1.03 | 76.1 | 👐 Yes |\n| **GLM-TTS_RL (Ours)** | **0.89** | 76.4 | 👐 Yes |\n\n## Project Structure\n\n```\nGLM-TTS\u002F\n├── glmtts_inference.py              # Main inference script, containing complete inference process\n├── glmtts_inference.sh              # Pre-trained model inference script\n├── configs\u002F                         # Configuration files directory\n│   ├── spk_prompt_dict.yaml         # Speaker prompt dictionary\n│   ├── lora_adapter_configV3.1.json # LoRA adapter configuration\n│   ├── G2P_able_1word.json          # Single character phoneme conversion configuration\n│   ├── G2P_all_phonemes.json        # Full phoneme list\n│   ├── G2P_replace_dict.jsonl       # Phoneme replacement dictionary\n│   └── custom_replace.jsonl         # Custom replacement rules\n├── cosyvoice\u002F                       # Cosyvoice module\n│   ├── cli\u002F\n│   │   └── frontend.py              # Text and speech frontend processing\n│   └── utils\u002F                       # Utility functions\n├── examples\u002F                        # Example data\n│   ├── *.jsonl                      # Example jsonl files\n│   └── prompt\u002F                      # Prompt audio directory\n│       ├── *.wav                    # Prompt audio (for research use only)\n│       └── LICENSE                  # Audio file license\n├── flow\u002F                            # Flow model related\n│   ├── dit.py                       # Diffusion Transformer implementation\n│   ├── flow.py                      # Streaming Flow model\n│   └── modules.py                   # Flow model basic modules\n├── grpo\u002F                            # Reinforcement learning module\n│   ├── grpo_utils.py                # GRPO algorithm implementation\n│   ├── reward_func.py               # Multi-reward functions\n│   ├── reward_server.py             # Distributed reward server\n│   ├── train_ds_grpo.py             # GRPO training script\n│   └── data\u002F                        # Training data and configuration\n├── llm\u002F                             # Large language model related\n│   └── glmtts.py                    # GLM-TTS LLM implementation\n├── frontend\u002F                        # Frontend model files\n│   ├── campplus.onnx                # Speaker embedding model\n│   └── cosyvoice_frontend.yaml      # Frontend configuration\n├── tools\u002F                           # Tool scripts\n│   ├── gradio_app.py                # Gradio interactive interface\n│   ├── ffmpeg_speech_control.py     # Audio processing tool\n│   └── flow_reconstruct.py          # Audio reconstruction\n└── utils\u002F                           # Common utilities\n    ├── tts_model_util.py            # TTS model utilities\n    ├── yaml_util.py                 # YAML configuration loading utility\n    ├── audio.py                     # Audio processing utility\n    ├── seed_util.py                 # Random seed utility\n    ├── block_mask_util.py           # Block mask utility\n    ├── vocos_util.py                # Vocos vocoder utility\n    ├── hift_util.py                 # Hift vocoder utility\n    ├── whisper_models\u002F              # Whisper model components\n    └── glm_g2p.py                   # Text to phoneme conversion\n```\n\n## Acknowledgments\n\nWe thank the following open-source projects for their support:\n\n- [CosyVoice](https:\u002F\u002Fgithub.com\u002FFunAudioLLM\u002FCosyVoice) - Providing frontend processing framework and high-quality vocoder\n- [Llama](https:\u002F\u002Fgithub.com\u002Fmeta-llama\u002Fllama) - Providing basic language model architecture\n- [Vocos](https:\u002F\u002Fgithub.com\u002Fcharactr-platform\u002Fvocos) - Providing high-quality vocoder\n- [GRPO-Zero](https:\u002F\u002Fgithub.com\u002Fpolicy-gradient\u002FGRPO-Zero) - Reinforcement learning algorithm implementation inspiration\n\n---\n## Citation\n\nIf you find GLM-TTS useful for your research, please cite our technical report:\n\n```bibtex\n@misc{cui2025glmttstechnicalreport,\n      title={GLM-TTS Technical Report}, \n      author={Jiayan Cui and Zhihan Yang and Naihan Li and Jiankun Tian and Xingyu Ma and Yi Zhang and Guangyu Chen and Runxuan Yang and Yuqing Cheng and Yizhi Zhou and Guochen Yu and Xiaotao Gu and Jie Tang},\n      year={2025},\n      eprint={2512.14291},\n      archivePrefix={arXiv},\n      primaryClass={cs.SD},\n      url={https:\u002F\u002Farxiv.org\u002Fabs\u002F2512.14291}, \n}","# GLM-TTS：基于多奖励强化学习的可控且富有情感表达的零样本TTS\n\n[中文阅读](README_zh.md)\n\n\u003Cdiv align=\"center\">\n\u003Cimg src=assets\u002Fimages\u002Flogo.svg  width=\"50%\"\u002F>\n\u003C\u002Fdiv>\n\n\u003Cp align=\"center\">\n    \u003Ca href=\"https:\u002F\u002Farxiv.org\u002Fabs\u002F2512.14291\" target=\"_blank\">📜 论文\u003C\u002Fa>\n    &nbsp;&nbsp;|&nbsp;&nbsp;\n    \u003Ca href=\"https:\u002F\u002Fhuggingface.co\u002Fzai-org\u002FGLM-TTS\" target=\"_blank\">🤗 HuggingFace\u003C\u002Fa>\n    &nbsp;&nbsp;|&nbsp;&nbsp;\n    \u003Ca href=\"https:\u002F\u002Fmodelscope.cn\u002Fmodels\u002FZhipuAI\u002FGLM-TTS\" target=\"_blank\">🤖 ModelScope\u003C\u002Fa>\n    &nbsp;&nbsp;|&nbsp;&nbsp;\n    \u003Ca href=\"https:\u002F\u002Faudio.z.ai\u002F\" target=\"_blank\"> 🛠️Audio.Z.AI\u003C\u002Fa>\n\u003C\u002Fp>\n\n## 模型介绍\nGLM-TTS 是一款基于大型语言模型的高质量文本到语音（TTS）合成系统，支持零样本语音克隆和流式推理。该系统采用两阶段架构：首先利用 LLM 生成语音标记序列，然后使用 Flow 模型将标记转换为高质量音频波形。通过引入多奖励强化学习框架，GLM-TTS 能够生成更具表现力和情感的语音，显著提升传统 TTS 系统的表现力。\n\n## 新闻与更新\n\n- **[2025.12.11]** 🎉 项目正式开源，包含推理脚本和一系列模型权重。\n- **[2025.12.17]** GLM-TTS 技术报告已在 arXiv 上发布：[2512.14291](https:\u002F\u002Farxiv.org\u002Fabs\u002F2512.14291)。\n- **[即将推出]** 2D Vocos 声码器更新正在进行中。\n- **[即将推出]** 通过强化学习优化的模型权重。\n\n## 特性\n\n- **零样本语音克隆**：仅需 3–10 秒的提示音频即可克隆任何说话者的音色。\n- **RL 增强的情感控制**：通过多奖励强化学习框架实现更自然的情感表达和韵律控制。\n- **流式推理**：支持实时流式音频生成，适用于交互式应用。\n- **高质量合成**：生成自然且富有表现力的语音，质量可媲美商业系统。\n- **多语言支持**：主要支持中文，同时也支持英文混合文本。\n- **音素级建模**：支持音素级别的文本到语音转换。\n- **灵活的推理方法**：支持多种采样策略和推理模式。\n\n## 快速入门\n\n### 环境搭建\n\n请确保使用 Python 3.10 至 Python 3.12 版本。\n\n```bash\n# 克隆仓库\ngit clone https:\u002F\u002Fgithub.com\u002Fzai-org\u002FGLM-TTS.git\ncd GLM-TTS\n\n# 安装依赖\npip install -r requirements.txt\n\n# 安装强化学习相关依赖（可选）\ncd grpo\u002Fmodules\ngit clone https:\u002F\u002Fgithub.com\u002Fs3prl\u002Fs3prl\ngit clone https:\u002F\u002Fgithub.com\u002Fomine-me\u002FLaughterSegmentation\n# 下载 wavlm_large_finetune.pth 并放置于 grpo\u002Fckpt 目录\n```\n\n### 下载预训练模型\n\n我们支持从 HuggingFace 或 ModelScope 下载完整的模型权重（包括分词器、LLM、Flow、声码器和前端处理模块）。\n\n```bash\n# 创建模型目录\nmkdir -p ckpt\n\n# 选项 1：从 HuggingFace 下载\npip install -U huggingface_hub\nhuggingface-cli download zai-org\u002FGLM-TTS --local-dir ckpt\n\n# 选项 2：从 ModelScope 下载\npip install -U modelscope\nmodelscope download --model ZhipuAI\u002FGLM-TTS --local_dir ckpt\n```\n\n### 运行推理演示\n\n#### 命令行推理\n\n```bash\npython glmtts_inference.py \\\n    --data=example_zh \\\n    --exp_name=_test \\\n    --use_cache \\\n    # --phoneme # 添加此标志以启用音素功能。\n```\n\n#### Shell 脚本推理\n\n```bash\nbash glmtts_inference.sh\n```\n\n#### 交互式 Web 界面\n\n```bash\npython -m tools.gradio_app\n```\n\n## 系统架构\n\n### 概述\n\n\nGLM-TTS 采用两阶段设计：第一阶段，基于 Llama 架构的大语言模型（LLM）将输入文本转换为语音标记序列；第二阶段，Flow Matching 模型将这些标记序列转换为高质量的梅尔频谱图，最后通过声码器生成音频波形。该系统支持零样本语音克隆，无需针对特定说话者进行微调，即可从提示音频中提取说话者特征。\n\n\u003Cdiv align=\"center\">\n  \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fzai-org_GLM-TTS_readme_82e07b36001c.png\" width=\"50%\" alt=\"GLM-TTS 架构\" title=\"GLM-TTS 架构\">\n\u003C\u002Fdiv>\n\n### 细粒度发音控制（Phoneme-in）\n\n对于需要高发音准确性的场景，如教育评估和有声读物，GLM-TTS 引入了 **Phoneme-in** 机制，以解决多音字（例如“行”可读作 *xíng* 或 *háng*）和生僻字的自动发音歧义问题。该机制支持 **“混合音素 + 文本”** 输入，从而对特定词汇的发音进行精确、定向的控制。\n\n- **混合训练**\n  在训练过程中，随机对部分文本进行 G2P（字符到音素）转换。这一策略迫使模型适应混合输入序列，使其在保留理解纯文本能力的同时，增强对音素输入的泛化能力。\n\n- **定向推理**\n  推理遵循 `G2P -> 表格查找替换 -> 混合输入` 的流程：\n  1. **全局转换**：获取输入文本的完整音素序列。\n  2. **动态替换**：利用“动态可控词典”，自动识别多音字或生僻字，并将其替换为目标音素。\n  3. **混合生成**：将替换后的音素与原始文本结合，作为混合输入送入 GLM-TTS。这样既能确保特定词语的精确发音，又能保持自然的韵律。\n\n### RL 对齐\n\n\u003Cdiv align=\"center\">\n  \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fzai-org_GLM-TTS_readme_fe248936c35a.png\" width=\"70%\" alt=\"GLM-TTS RL\" title=\"GLM-TTS RL\">\n\u003C\u002Fdiv>\n\n为了解决传统 TTS 情感表达平淡的问题，我们引入了多奖励强化学习框架。该框架通过多个奖励函数（包括相似度奖励、CER 奖励、情感奖励、笑声奖励等）对生成的语音进行全面评估，并使用 GRPO（Group Relative Policy Optimization）算法优化 LLM 的生成策略。具体来说：\n\n1. **多奖励设计**：系统设计了多种奖励函数，从不同维度评估生成语音的质量，包括音质、相似度、情感表达等。\n2. **奖励服务器**：通过分布式奖励服务器计算多个奖励函数，支持并行处理。\n3. **策略优化**：基于奖励信号，使用 GRPO 算法优化 LLM 的生成策略，从而提升语音的情感表现力。\n4. **词元级奖励**：支持细粒度的词元级奖励分配，提供更精确的优化信号。\n\n通过 RL 优化，GLM-TTS_RL 相较于基础模型，将 CER 指标从 1.03 降低至 0.89，同时保持高相似度，实现了更好的音质和表现力。\n\n## 核心组件与实现\n\n### LLM 后端\n- **文件位置**：[`llm\u002Fglmtts.py`](llm\u002Fglmtts.py)\n- **功能**：基于 Llama 架构的文本到语音模型，负责将输入文本转换为语音词元序列。\n- **支持模式**：预训练（PRETRAIN）、微调（SFT）和 LoRA 模式。\n\n### 流匹配\n- **文件位置**：[`flow\u002F`](flow\u002F) 目录\n- **核心文件**：\n  - [`dit.py`](flow\u002Fdit.py)：扩散 Transformer 实现，支持条件生成。\n  - [`flow.py`](flow\u002Fflow.py)：流式推理支持，实现实时音频生成。\n- **功能**：将 LLM 生成的词元序列转换为高质量的梅尔谱图。\n\n### 前端\n- **文件位置**：[`cosyvoice\u002Fcli\u002Ffrontend.py`](cosyvoice\u002Fcli\u002Ffrontend.py)\n- **功能**：对文本和语音进行预处理，包括文本归一化、音素转换、语音词元提取以及说话人嵌入提取。\n- **特性**：支持中英文混合文本处理。\n\n### 强化学习模块\n- **文件位置**：[`grpo\u002F`](grpo\u002F) 目录\n- **核心文件**：\n  - [`grpo_utils.py`](grpo\u002Fgrpo_utils.py)：GRPO 算法实现及批量推理。\n  - [`reward_func.py`](grpo\u002Freward_func.py)：多奖励函数实现。\n  - [`reward_server.py`](grpo\u002Freward_server.py)：分布式奖励服务器。\n- **功能**：通过多奖励强化学习优化 TTS 系统的情感表现力。\n\n## 评估结果\n\n在 `seed-tts-eval zh testset` 上进行评估。为保持与原评估的一致性，推理过程中未使用 `--phoneme` 标志。\n\n**CER**：字符错误率（越低越好 $\\downarrow$）| **SIM**：相似度（越高越好 $\\uparrow$）\n\n| 模型 | CER $\\downarrow$ | SIM $\\uparrow$ | 开源 |\n| :--- | :---: | :---: | :---: |\n| MegaTTS3 | 1.52 | 79.0 | 🔒 否 |\n| DiTAR | 1.02 | 75.3 | 🔒 否 |\n| CosyVoice3 | 1.12 | 78.1 | 🔒 否 |\n| Seed-TTS | 1.12 | **79.6** | 🔒 否 |\n| MiniMax | **0.83** | 78.3 | 🔒 否 |\n| CosyVoice2 | 1.38 | 75.7 | 👐 是 |\n| F5-TTS | 1.53 | 76.0 | 👐 是 |\n| FireRedTTS-2 | 1.14 | 73.6 | 👐 是 |\n| IndexTTS2 | 1.03 | 76.5 | 👐 是 |\n| VibeVoice | 1.16 | 74.4 | 👐 是 |\n| HiggsAudio-v2 | 1.50 | 74.0 | 👐 是 |\n| VoxCPM | 0.93 | 77.2 | 👐 是 |\n| **GLM-TTS（我们的模型）** | 1.03 | 76.1 | 👐 是 |\n| **GLM-TTS_RL（我们的模型）** | **0.89** | 76.4 | 👐 是 |\n\n## 项目结构\n\n```\nGLM-TTS\u002F\n├── glmtts_inference.py              # 主推理脚本，包含完整的推理流程\n├── glmtts_inference.sh              # 预训练模型推理脚本\n├── configs\u002F                         # 配置文件目录\n│   ├── spk_prompt_dict.yaml         # 说话人提示词字典\n│   ├── lora_adapter_configV3.1.json # LoRA 适配器配置\n│   ├── G2P_able_1word.json          # 单个字符音素转换配置\n│   ├── G2P_all_phonemes.json        # 全部音素列表\n│   ├── G2P_replace_dict.jsonl       # 音素替换字典\n│   └── custom_replace.jsonl         # 自定义替换规则\n├── cosyvoice\u002F                       # Cosyvoice 模块\n│   ├── cli\u002F\n│   │   └── frontend.py              # 文本和语音前端处理\n│   └── utils\u002F                       # 工具函数\n├── examples\u002F                        # 示例数据\n│   ├── *.jsonl                      # 示例 jsonl 文件\n│   └── prompt\u002F                      # 提示音频目录\n│       ├── *.wav                    # 提示音频（仅用于研究）\n│       └── LICENSE                  # 音频文件许可\n├── flow\u002F                            # 流模型相关\n│   ├── dit.py                       # 连续扩散 Transformer 实现\n│   ├── flow.py                      # 流式流模型\n│   └── modules.py                   # 流模型基础模块\n├── grpo\u002F                            # 强化学习模块\n│   ├── grpo_utils.py                # GRPO 算法实现\n│   ├── reward_func.py               # 多奖励函数\n│   ├── reward_server.py             # 分布式奖励服务器\n│   ├── train_ds_grpo.py             # GRPO 训练脚本\n│   └── data\u002F                        # 训练数据和配置\n├── llm\u002F                             # 大语言模型相关\n│   └── glmtts.py                    # GLM-TTS LLM 实现\n├── frontend\u002F                        # 前端模型文件\n│   ├── campplus.onnx                # 说话人嵌入模型\n│   └── cosyvoice_frontend.yaml      # 前端配置\n├── tools\u002F                           # 工具脚本\n│   ├── gradio_app.py                # Gradio 交互界面\n│   ├── ffmpeg_speech_control.py     # 音频处理工具\n│   └── flow_reconstruct.py          # 音频重建\n└── utils\u002F                           # 公用工具\n    ├── tts_model_util.py            # TTS 模型工具\n    ├── yaml_util.py                 # YAML 配置加载工具\n    ├── audio.py                     # 音频处理工具\n    ├── seed_util.py                 # 随机种子工具\n    ├── block_mask_util.py           # 块掩码工具\n    ├── vocos_util.py                # Vocos 编码器工具\n    ├── hift_util.py                 # Hift 编码器工具\n    ├── whisper_models\u002F              # Whisper 模型组件\n    └── glm_g2p.py                   # 文本到音素转换\n```\n\n## 致谢\n\n我们感谢以下开源项目的支持：\n\n- [CosyVoice](https:\u002F\u002Fgithub.com\u002FFunAudioLLM\u002FCosyVoice) - 提供前端处理框架和高质量声码器\n- [Llama](https:\u002F\u002Fgithub.com\u002Fmeta-llama\u002Fllama) - 提供基础语言模型架构\n- [Vocos](https:\u002F\u002Fgithub.com\u002Fcharactr-platform\u002Fvocos) - 提供高质量声码器\n- [GRPO-Zero](https:\u002F\u002Fgithub.com\u002Fpolicy-gradient\u002FGRPO-Zero) - 强化学习算法实现的灵感来源\n\n---\n## 引用\n\n如果您在研究中使用了 GLM-TTS，请引用我们的技术报告：\n\n```bibtex\n@misc{cui2025glmttstechnicalreport,\n      title={GLM-TTS 技术报告}, \n      author={Jiayan Cui 和 Zhihan Yang 和 Naihan Li 和 Jiankun Tian 和 Xingyu Ma 和 Yi Zhang 和 Guangyu Chen 和 Runxuan Yang 和 Yuqing Cheng 和 Yizhi Zhou 和 Guochen Yu 和 Xiaotao Gu 和 Jie Tang},\n      year={2025},\n      eprint={2512.14291},\n      archivePrefix={arXiv},\n      primaryClass={cs.SD},\n      url={https:\u002F\u002Farxiv.org\u002Fabs\u002F2512.14291}, \n}","# GLM-TTS 快速上手指南\n\nGLM-TTS 是一个基于大语言模型的高质量文本转语音（TTS）系统，支持零样本声音克隆、流式推理以及通过多奖励强化学习实现的情感表达控制。\n\n## 1. 环境准备\n\n在开始之前，请确保您的开发环境满足以下要求：\n\n*   **操作系统**: Linux (推荐) 或 macOS\n*   **Python 版本**: 3.10 - 3.12\n*   **硬件要求**: 建议使用 NVIDIA GPU 以获得最佳推理速度\n*   **网络环境**: 需要访问 HuggingFace 或 ModelScope 下载模型权重\n\n## 2. 安装步骤\n\n### 2.1 克隆项目代码\n\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002Fzai-org\u002FGLM-TTS.git\ncd GLM-TTS\n```\n\n### 2.2 安装基础依赖\n\n```bash\npip install -r requirements.txt\n```\n\n### 2.3 安装强化学习相关依赖（可选）\n\n如果您计划使用或研究强化学习（RL）相关功能，请执行以下步骤：\n\n```bash\ncd grpo\u002Fmodules\ngit clone https:\u002F\u002Fgithub.com\u002Fs3prl\u002Fs3prl\ngit clone https:\u002F\u002Fgithub.com\u002Fomine-me\u002FLaughterSegmentation\n# 注意：需手动下载 wavlm_large_finetune.pth 并放置于 grpo\u002Fckpt 目录\ncd ..\u002F..\n```\n\n### 2.4 下载预训练模型\n\n推荐使用 **ModelScope (魔搭)** 国内镜像源加速下载，也可选择 HuggingFace。\n\n**方式一：使用 ModelScope（推荐国内用户）**\n\n```bash\npip install -U modelscope\nmodelscope download --model ZhipuAI\u002FGLM-TTS --local_dir ckpt\n```\n\n**方式二：使用 HuggingFace**\n\n```bash\npip install -U huggingface_hub\nhuggingface-cli download zai-org\u002FGLM-TTS --local-dir ckpt\n```\n\n## 3. 基本使用\n\n安装完成后，您可以通过以下三种方式进行推理测试。\n\n### 3.1 命令行推理（最简示例）\n\n运行以下命令即可使用默认示例数据进行测试：\n\n```bash\npython glmtts_inference.py \\\n    --data=example_zh \\\n    --exp_name=_test \\\n    --use_cache\n```\n\n> **提示**: 如需启用音素级控制（提高生僻字或多音字准确率），请添加 `--phoneme` 参数。\n\n### 3.2 脚本化推理\n\n项目提供了封装好的 Shell 脚本，方便批量或标准化运行：\n\n```bash\nbash glmtts_inference.sh\n```\n\n### 3.3 交互式 Web 界面\n\n启动 Gradio 网页界面，可在浏览器中实时体验声音克隆和文本合成：\n\n```bash\npython -m tools.gradio_app\n```\n\n启动后，请在终端输出的地址（通常为 `http:\u002F\u002Flocalhost:7860`）打开浏览器，上传 3-10 秒的参考音频即可开始零样本克隆。","某互动有声书创作团队正致力于将经典文学作品快速转化为具有丰富情感色彩的多人广播剧，以满足听众对沉浸式听觉体验的需求。\n\n### 没有 GLM-TTS 时\n- **录音成本高昂**：为每个角色寻找专业配音演员耗时耗力，且难以协调档期，导致项目启动缓慢。\n- **情感表达僵硬**：传统 TTS 生成的语音语调平淡，无法精准还原故事中愤怒、悲伤或惊喜等细腻情绪，听众极易出戏。\n- **声音克隆门槛高**：若想模仿特定知名主播的声音，通常需要录制数小时的高质量素材进行模型训练，数据准备周期长达数周。\n- **实时交互缺失**：生成音频需等待完整文本处理完毕，无法支持用户与故事角色进行实时的语音互动玩法。\n\n### 使用 GLM-TTS 后\n- **零样本快速复刻**：仅需提供角色 3-10 秒的参考音频，GLM-TTS 即可通过零样本克隆技术瞬间锁定声线，立即开始批量合成。\n- **多奖励强化学习赋能**：依托其多奖励强化学习框架，GLM-TTS 能自动生成抑扬顿挫的语调，精准演绎复杂情感，听感媲美真人演播。\n- **流式推理支持互动**：利用流式推理特性，GLM-TTS 可实现低延迟的实时语音生成，让听众能随时打断并与书中角色进行自然对话。\n- **中英混合无缝切换**：在处理包含英文专有名词或对话的中文文本时，GLM-TTS 能保持发音自然流畅，无需额外调整参数。\n\nGLM-TTS 通过零样本克隆与强化学习驱动的情感控制，将广播剧制作周期从数周缩短至数小时，同时大幅提升了听觉沉浸感。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fzai-org_GLM-TTS_e3d4d988.png","zai-org","Z.ai","https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002Fzai-org_f0d5ae80.png","ChatGLM, GLM-4.5, CogVLM, CodeGeeX, CogView, CogVideoX | CogDL, AMiner | Zhipu.ai (Z.ai)",null,"Zai_org","https:\u002F\u002Fwww.zhipuai.cn\u002Fen","https:\u002F\u002Fgithub.com\u002Fzai-org",[81,85],{"name":82,"color":83,"percentage":84},"Python","#3572A5",99.6,{"name":86,"color":87,"percentage":88},"Shell","#89e051",0.4,966,118,"2026-04-08T01:25:48","Apache-2.0","未说明","未说明（基于 LLM 和 Flow Matching 架构，通常推理需要 NVIDIA GPU，具体显存需求未提及）",{"notes":96,"python":97,"dependencies":98},"1. 必须使用 Python 3.10 至 3.12 版本。\n2. 支持从 HuggingFace 或 ModelScope 下载完整模型权重（包含 Tokenizer, LLM, Flow, Vocoder, Frontend）。\n3. 若需使用强化学习相关功能，需手动克隆 s3prl 和 LaughterSegmentation 仓库，并下载 wavlm_large_finetune.pth 模型文件放置于指定目录。\n4. 提供命令行、Shell 脚本和 Gradio Web 界面三种推理方式。\n5. 支持零样本语音克隆（仅需 3-10 秒提示音频）和流式推理。","3.10 - 3.12",[99,100,101,102,103],"huggingface_hub","modelscope","gradio","s3prl (可选，用于强化学习)","requirements.txt 中定义的其他依赖",[14,105,35],"音频",[107,108,109],"edge-computing","llm","tts","2026-03-27T02:49:30.150509","2026-04-08T20:38:24.404905",[113,118,123,128,133,138,143],{"id":114,"question_zh":115,"answer_zh":116,"source_url":117},25027,"如何在 Windows 或 macOS 上解决依赖安装失败（特别是 pynini 和 onnxruntime）的问题？","建议使用 Miniconda 混合安装。具体方案如下：\n1. 重点修改依赖版本：将 `onnxruntime_gpu` 改为 `onnxruntime==1.19.0`（ARM 芯片 Mac 不支持 gpu 版本），`gradio` 调整为 `5.49.0`。\n2. 安装策略：`WeTextProcessing==1.0.3` 必须使用 conda 单独安装（`conda install WeTextProcessing==1.0.3`），其他依赖尝试用 pip 安装。若遇到 pip 编译失败的包，均改用 conda 安装。\n3. 代码调整：在 `gradio_app.py` 中删除 theme 相关内容。\n4. 运行环境：若报错 CUDA 不可用，需根据日志将相关 py 文件中的 cuda 改为 cpu 或 macos 支持的 mps（注意 mps 偶尔不稳定，推荐先用 cpu）。\n5. Python 版本建议：避免使用 Python 3.12，部分旧依赖对版本支持有限，可尝试 Python 3.10 或 3.11。","https:\u002F\u002Fgithub.com\u002Fzai-org\u002FGLM-TTS\u002Fissues\u002F42",{"id":119,"question_zh":120,"answer_zh":121,"source_url":122},25028,"GLM-TTS 项目与 CosyVoice 有什么区别？是否支持情感控制和半精度推理？","1. 项目关系：该项目并非 CosyVoice-3 的实例，训练过程未引入额外的设计特征（如 MeanFlow），曾尝试但未获得更稳定的结果。\n2. 情感控制：目前主要关注基础合成，关于情感可控合成的具体支持情况需参考最新文档，但核心架构未特意强调此功能。\n3. 半精度推理（FP16）：团队曾尝试 FP16 clamping 训练以减少推理时的数值溢出概率，但这会导致语音质量下降。目前 Flow-matching 架构在 TRT-FP16 推理上的表现需自行测试，官方未明确确认其完美支持。\n4. 采样步数：仅需 1-2 次迭代步即可生成具有良好说话人相似度的音频，这是模型特性所致，并非引入了特殊的 MeanFlow 设计。","https:\u002F\u002Fgithub.com\u002Fzai-org\u002FGLM-TTS\u002Fissues\u002F5",{"id":124,"question_zh":125,"answer_zh":126,"source_url":127},25029,"LLM 部分是基于预训练的 Llama 权重初始化的吗？","不是。虽然架构基于 Llama，但团队进行过实验，发现加载与否区别不大。最终的模型并没有加载 Llama 的预训练权重，而是从头开始训练的。","https:\u002F\u002Fgithub.com\u002Fzai-org\u002FGLM-TTS\u002Fissues\u002F40",{"id":129,"question_zh":130,"answer_zh":131,"source_url":132},25030,"为什么使用 cosyvoice-ttsfrd 时输出的中文之间会插入不存在的英文内容（如 OODS, OODI）？","请不要使用 **ttsfrd** 库。代码中保留这部分是为了尊重原始 CosyVoice frontend.py 的代码结构，但实际上并未被使用。请切换回使用 `WeTextProcessing` 进行文本处理，即可避免该问题。","https:\u002F\u002Fgithub.com\u002Fzai-org\u002FGLM-TTS\u002Fissues\u002F26",{"id":134,"question_zh":135,"answer_zh":136,"source_url":137},25031,"Vocos2 声码器重建音频时低音效果差、有噪声或不稳定，如何解决？","这是 Vocos2 及其他基于中间时频谱重建的声码器的固有特性：高音性能稳定且无金属感，但低音（尤其是低基频男声、气泡音）容易模糊成喘气声；而直接重建波形的声码器低音更稳但高音可能电音重。\n改进建议：\n1. 数据层面：训练数据多为干声，若输入音频自带混响可能导致效果不佳。\n2. 训练配置：若低频带（或低基频）上采样效果差，可在训练时于多分辨率判别器配置中增加几个粗分辨率频带，可能有助于改进效果。","https:\u002F\u002Fgithub.com\u002Fzai-org\u002FGLM-TTS\u002Fissues\u002F12",{"id":139,"question_zh":140,"answer_zh":141,"source_url":142},25032,"prompt_text 正则化处理时末尾添加空格导致偶发多字问题，该如何处理？","最初在 `norm_prompt_text` 后加空格是为了让 LLM 更好地区分 prompt text 和 synth text。但近期实验证明，不加空格的效果也很好，且能解决 `use_cache=false` 时的偶发多字问题。建议去掉末尾的空格。","https:\u002F\u002Fgithub.com\u002Fzai-org\u002FGLM-TTS\u002Fissues\u002F45",{"id":144,"question_zh":145,"answer_zh":146,"source_url":147},25033,"在 Apple M1\u002FM2 芯片上运行时遇到 'Torch not compiled with CUDA enabled' 错误怎么办？","苹果芯片不支持 CUDA。您需要将代码中涉及设备选择的逻辑修改为使用 CPU 或 MPS (Metal Performance Shaders)。\n1. 查找报错日志对应的 py 文件。\n2. 将设备参数从 'cuda' 改为 'cpu' 或 'mps'。\n注意：有用户反馈 MPS 偶尔会出现问题，如果稳定性优先，建议暂时使用 'cpu' 模式，虽然速度会稍慢。","https:\u002F\u002Fgithub.com\u002Fzai-org\u002FGLM-TTS\u002Fissues\u002F31",[]]