GraySoft
Projects Models Compare Cloud benchmarks FAQ Download guIDE →
Model Intelligence Sheet

WariHima/hourai2-pl-2m-32dim-gguf overview

蓬莱2 PL Phone Level 2m 32dim gguf Phoneme Level LLM for TTS Speaking Style Encoder for aquestalk like japanese phoneme like text style Style TTS2のPL BERTのように動作す…

ggufjabase_model:WariHima/hourai2-pl-2m-32dimbase_model:quantized:WariHima/hourai2-pl-2m-32dimlicense:apache-2.0endpoints_compatibleregion:us

Runs locally from ~4.4 MB disk (4 GB VRAM class GPUs with llama.cpp / guIDE).

Downloads
0
Likes
0
Pipeline
Author

Repository Files & Downloads

1 GGUF files detected
Direct downloads for local inference
FileTypeQuantizationSizeLink
hourai2-pl-2m-32dim.ggufGGUFGGUF4.4 MBDownload

Model Details

Model IDWariHima/hourai2-pl-2m-32dim-gguf
AuthorWariHima
Pipeline
Licenseapache-2.0
Base modelWariHima/hourai2-pl-2m-32dim
Last modified2026-07-26T06:16:02.000Z

Model README

---

license: apache-2.0

language:

  • ja

base_model:

  • WariHima/hourai2-pl-2m-32dim

---

蓬莱2 PL (Phone Level) 2m 32dim gguf

Phoneme Level LLM for TTS Speaking Style Encoder

for aquestalk like japanese phoneme (like) text style

Style-TTS2のPL BERTのように動作することを期待した、

アクエストーク記法によるテキストスタイルエンコーダ用モデルです。

ttsモデル用のため。単体では動作しません。

使い方 (python)

$ pip install llama-cpp-python
$ pip install tokenizers
import llama_cpp
from tokenizers import Tokenizer

# 1. モデルロード (embedding=True)
llm = llama_cpp.Llama(
    model_path="./hourai2-pl-2m-32dim.gguf",
    embedding=True,
    verbose=False
)

# 2. tokenizers ライブラリで ID 化
tokenizer = Tokenizer.from_file("./tokenizer.json")
text = "コンニチハ"
token_ids = tokenizer.encode(text).ids  # [10, 41, 22, 17, 26]

print("Token IDs:", token_ids)

# --- ここから embed() メソッド内部処理の再現 ---

n_embd = llm.n_embd()
n_batch = llm.n_batch
pooling_type = llm.pooling_type()

# トークン数のチェック
n_tokens = len(token_ids)
if n_tokens > n_batch:
    raise ValueError(f"Requested tokens ({n_tokens}) exceed batch size of {n_batch}")

# バッチのリセットとシーケンス追加
llm._batch.reset()

# embed() 内の仕様に従い logits_all = True でシーケンス登録
# (配列, seq_id, logits_all)
llm._batch.add_sequence(token_ids, 0, True)

# KVキャッシュのクリアとモデルデコード(C++層の計算実行)
llm._ctx.kv_cache_clear()
llm._ctx.decode(llm._batch)

# 埋め込みベクトルの抽出 (pooling_type の判定処理)
if pooling_type == llama_cpp.LLAMA_POOLING_TYPE_NONE:
    # トークンごとの埋め込み (shape: [n_tokens, n_embd])
    ptr = llama_cpp.llama_get_embeddings(llm._ctx.ctx)
    embedding = [
        ptr[j * n_embd : (j + 1) * n_embd]
        for j in range(n_tokens)
    ]
else:
    # 文全体のプーリング埋め込み (shape: [n_embd])
    ptr = llama_cpp.llama_get_embeddings_seq(llm._ctx.ctx, 0)
    embedding = ptr[:n_embd]

# クリーンアップ
llm._batch.reset()
llm._ctx.kv_cache_clear()
llm.reset()

# --- 取得結果 ---
print("\nEmbedding 取得成功!")
if pooling_type == llama_cpp.LLAMA_POOLING_TYPE_NONE:
    print(f"トークン数: {len(embedding)}, 次元数: {len(embedding[0])}")
else:
    print(f"ベクトル次元数: {len(embedding)}")
    print("先頭 5 要素:", embedding[:5])

Run WariHima/hourai2-pl-2m-32dim-gguf with guIDE

Download guIDE — the AI-native code editor with local LLM inference and 69 built-in tools.

Download guIDE → · Browse 524k+ models · Compare models

Source: Hugging Face · Compare models