Cisimi V0.1
模型简介
CiSiMi是一个基于OuteTTS-0.3-500M的文本转音频模型,能够处理文本输入并以文本和音频形式响应。该模型专为资源受限环境设计,能够通过llama.cpp在CPU上高效运行。
模型特点
资源高效
专为资源受限环境设计,能够在CPU上高效运行
开源工具
基于开源工具构建,展示了开源工具在创建可访问语音技术方面的力量
早期原型
虽然仍处于早期阶段,但代表了向普及高级文本转音频能力迈出的一步
模型能力
文本转音频
语音合成
英语语音生成
使用案例
语音助手
语音问答
用户输入文本问题,模型以语音形式回答
生成自然语音响应
教育
语音学习辅助
将文本学习材料转换为语音形式
帮助视觉障碍学习者或提供多模态学习体验
🚀 CiSiMi:一款文本转语音(TTS)模型
CiSiMi是一款文本转语音模型的早期原型,它可以处理文本输入,并以文本和音频两种形式作出响应。该模型专为资源受限的环境而构建,旨在使用llama.cpp在CPU上高效运行,即使没有强大的GPU,也能实现高级语音合成。
🚀 快速开始
CiSiMi是一款文本转语音模型的早期原型,它能够处理文本输入,并以文本和音频形式作出响应。该模型专为资源受限的环境打造,可借助llama.cpp在CPU上高效运行,让高级语音合成功能在没有强大GPU的情况下也能实现。
✨ 主要特性
- 资源友好:专为资源受限环境设计,可在CPU上高效运行,无需强大GPU支持。
- 多模态输出:能够同时输出文本和音频,提供丰富的交互体验。
- 开源驱动:利用开源工具构建,推动语音技术的普及。
📦 安装指南
pip install outetts llama-cpp-python --upgrade
pip install huggingface_hub sounddevice
💻 使用示例
基础用法
import torch
import outetts
import numpy as np
from huggingface_hub import hf_hub_download
from outetts.wav_tokenizer.audio_codec import AudioCodec
from outetts.version.v2.prompt_processor import PromptProcessor
from outetts.version.playback import ModelOutput
# Download the model
model_path = hf_hub_download(
repo_id="KandirResearch/CiSiMi-v0.1",
filename="unsloth.Q8_0.gguf",
)
# Configure the model
model_config = outetts.GGUFModelConfig_v2(
model_path=model_path,
tokenizer_path="KandirResearch/CiSiMi-v0.1",
)
# Initialize components
interface = outetts.InterfaceGGUF(model_version="0.3", cfg=model_config)
audio_codec = AudioCodec()
prompt_processor = PromptProcessor("KandirResearch/CiSiMi-v0.1")
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
gguf_model = interface.get_model()
# Helper function to extract audio from tokens
def get_audio(tokens):
outputs = prompt_processor.extract_audio_from_tokens(tokens)
if not outputs:
return None
audio_tensor = audio_codec.decode(torch.tensor([[outputs]], dtype=torch.int64).to(device))
return ModelOutput(audio_tensor, audio_codec.sr)
# Helper function to clean text output
def extract_text_from_tts_output(tts_output):
text = ""
for line in tts_output.strip().split('\n'):
if '<|audio_end|>' in line or '<|im_end|>' in line:
continue
if '<|' in line:
word = line.split('<|')[0].strip()
if word:
text += word + " "
else:
text += line.strip() + " "
return text.strip()
# Generate response function
def generate_response(instruction):
prompt = f"<|im_start|>\nInstructions:\n{instruction}\n<|im_end|>\nAnswer:\n"
gen_cfg = outetts.GenerationConfig(
text=prompt,
temperature=0.6,
repetition_penalty=1.1,
max_length=4096,
speaker=None
)
input_ids = prompt_processor.tokenizer.encode(prompt)
tokens = gguf_model.generate(input_ids, gen_cfg)
output_text = prompt_processor.tokenizer.decode(tokens, skip_special_tokens=False)
if "<|audio_end|>" in output_text:
first_part, _, _ = output_text.partition("<|audio_end|>")
if "<|audio_end|>\n<|im_end|>\n" not in first_part:
first_part += "<|audio_end|>\n<|im_end|>\n"
extracted_text = extract_text_from_tts_output(first_part)
audio_start_pos = first_part.find("<|audio_start|>\n") + len("<|audio_start|>\n")
audio_end_pos = first_part.find("<|audio_end|>\n<|im_end|>\n") + len("<|audio_end|>\n<|im_end|>\n")
if audio_start_pos >= len("<|audio_start|>\n") and audio_end_pos > audio_start_pos:
audio_tokens_text = first_part[audio_start_pos:audio_end_pos]
audio_tokens = prompt_processor.tokenizer.encode(audio_tokens_text)
audio_output = get_audio(audio_tokens)
if audio_output is not None and hasattr(audio_output, 'audio') and audio_output.audio is not None:
audio_numpy = audio_output.audio.cpu().numpy()
if audio_numpy.ndim > 1:
audio_numpy = audio_numpy.squeeze()
return extracted_text, (audio_output.sr, audio_numpy)
return output_text, None
# Example usage
question = "What is the meaning of life?"
response_text, response_audio = generate_response(question)
print(response_text)
# Play audio if available
if response_audio is not None:
if "ipykernel" in sys.modules:
from IPython.display import display, Audio
display(Audio(response_audio[1], rate=response_audio[0], autoplay=True))
else:
import sounddevice as sd
sd.play(response_audio[1], samplerate=response_audio[0])
sd.wait()
🔧 技术细节
模型规格
属性 | 详情 |
---|---|
模型架构 | 基于OuteTTS - 0.3 - 500M |
支持语言 | 英语 |
处理流程 | 文本转音频 |
参数数量 | 5亿 |
训练数据集规模 | 约1.5万个样本 |
未来目标 | 扩展到20万 - 50万个样本的数据集,支持多轮对话,使用5亿和10亿参数的模型变体,并添加实时流式传输功能 |
训练方法
- 数据集准备:
- 从[gruhit - patel/alpaca_speech_instruct](https://huggingface.co/datasets/gruhit - patel/alpaca_speech_instruct)开始。
- 清理数据,去除代码、数学表达式和非英语内容。
- 过滤数据,仅保留输入 + 输出文本不超过256个标记的条目。
- 音频生成:
- 使用[hexgrad/Kokoro - 82M](https://huggingface.co/hexgrad/Kokoro - 82M)将文本输出转换为语音。
- 使用OpenAI Whisper验证每个音频生成结果。
- 将生成的数据集发布为KandirResearch/Speech2Speech。
- 模型训练:
- 使用修改后的OuteTTS方法预处理数据集([训练详情](https://github.com/edwko/OuteTTS/blob/8eb0fa369df6f3c062f7084ddc33d10bc28992be/examples/training/OuteTTS - 0.3/train.md))。
- 使用Unsloth SFT对[OuteAI/OuteTTS - 0.3 - 500M](https://huggingface.co/OuteAI/OuteTTS - 0.3 - 500M)进行微调。
- 训练6个周期,损失达到2.27,作为概念验证。
📄 许可证
本项目采用CC - BY - SA 4.0许可证。
局限性与未来工作
这个早期原型有几个需要改进的地方:
- 训练数据有限(约1.5万个样本)。
- 基本的提示/聊天模板结构。
- 有优化训练超参数的空间。
- 具备实现多轮对话能力的潜力。
潜在限制:这种类型的模型会迅速填满上下文窗口,因此较小的模型通常更适合实际应用。
致谢与引用
本模型基于以下开源项目构建:
- [OuteAI/OuteTTS - 0.3 - 500M](https://huggingface.co/OuteAI/OuteTTS - 0.3 - 500M) - 基础模型
- [gruhit - patel/alpaca_speech_instruct](https://huggingface.co/datasets/gruhit - patel/alpaca_speech_instruct) - 初始数据集
- [hexgrad/Kokoro - 82M](https://huggingface.co/hexgrad/Kokoro - 82M) - 文本转语音生成
- OpenAI Whisper - 语音验证
- Unsloth - 训练优化
Kokoro 82M
Apache-2.0
Kokoro是一款拥有8200万参数的开源文本转语音(TTS)模型,以其轻量级架构和高音质著称,同时具备快速和成本效益高的特点。
语音合成 英语
K
hexgrad
2.0M
4,155
XTTS V2
其他
ⓍTTS是一款革命性的语音生成模型,仅需6秒音频片段即可实现跨语言音色克隆,支持17种语言。
语音合成
X
coqui
1.7M
2,630
F5 TTS
F5-TTS 是一个基于流匹配的语音合成模型,专注于流畅且忠实的语音合成,特别适用于童话讲述等场景。
语音合成
F
SWivid
851.49k
1,000
Bigvgan V2 22khz 80band 256x
MIT
BigVGAN是基于大规模训练的通用神经声码器,能够从梅尔频谱生成高质量音频波形。
语音合成
B
nvidia
503.23k
16
Speecht5 Tts
MIT
基于LibriTTS数据集微调的SpeechT5语音合成(文本转语音)模型,支持高质量的文本转语音转换。
语音合成
Transformers

S
microsoft
113.83k
760
Dia 1.6B
Apache-2.0
Dia是由Nari实验室开发的16亿参数文本转语音模型,能够直接从文本生成高度逼真的对话,支持情感和语调控制,并能生成非语言交流内容。
语音合成
Safetensors 英语
D
nari-labs
80.28k
1,380
Csm 1b
Apache-2.0
CSM是Sesame开发的10亿参数规模语音生成模型,可根据文本和音频输入生成RVQ音频编码
语音合成
Safetensors 英语
C
sesame
65.03k
1,950
Kokoro 82M V1.1 Zh
Apache-2.0
Kokoro 是一个开放权重的小型但功能强大的文本转语音(TTS)模型系列,新增了来自专业数据集的100名中文说话人数据。
语音合成
K
hexgrad
51.56k
112
Indic Parler Tts
Apache-2.0
Indic Parler-TTS 是 Parler-TTS Mini 的多语言印度语言扩展版本,支持21种语言,包括多种印度语言和英语。
语音合成
Transformers 支持多种语言

I
ai4bharat
43.59k
124
Bark
MIT
Bark是由Suno创建的基于Transformer的文本转音频模型,能生成高度逼真的多语言语音、音乐、背景噪音和简单音效。
语音合成
Transformers 支持多种语言

B
suno
35.72k
1,326
精选推荐AI模型
Llama 3 Typhoon V1.5x 8b Instruct
专为泰语设计的80亿参数指令模型,性能媲美GPT-3.5-turbo,优化了应用场景、检索增强生成、受限生成和推理任务
大型语言模型
Transformers 支持多种语言

L
scb10x
3,269
16
Cadet Tiny
Openrail
Cadet-Tiny是一个基于SODA数据集训练的超小型对话模型,专为边缘设备推理设计,体积仅为Cosmo-3B模型的2%左右。
对话系统
Transformers 英语

C
ToddGoldfarb
2,691
6
Roberta Base Chinese Extractive Qa
基于RoBERTa架构的中文抽取式问答模型,适用于从给定文本中提取答案的任务。
问答系统 中文
R
uer
2,694
98