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