Model Intelligence Sheet
WariHima/hourai2-en-37m-gguf overview
hourai2 en 37m gguf english only 100 vocab size model for english auto complete llama2 baseモデルのような文章予測モデルです。 英語の入力予測用途に絞っているため、語彙をasciiコード範囲に絞っています。 使い方 from t…
Runs locally from ~72.3 MB disk (4 GB VRAM class GPUs with llama.cpp / guIDE).
Repository Files & Downloads
1 GGUF files detected
Direct downloads for local inference
| File | Type | Quantization | Size | Link |
|---|---|---|---|---|
| hourai2-en-37m.gguf | GGUF | GGUF | 72.3 MB | Download |
Model Details
Model README
---
license: apache-2.0
language:
- en
base_model:
- WariHima/hourai2-en-37m
---
hourai2 en 37m gguf
english only 100 vocab size model for english auto-complete
llama2-baseモデルのような文章予測モデルです。
英語の入力予測用途に絞っているため、語彙をasciiコード範囲に絞っています。
使い方
from typing import Optional, List
import llama_cpp
from tokenizers import Tokenizer
class Hourai2enForGGUF(llama_cpp.Llama):
def load_tokenizer(self):
self.tokenizer = Tokenizer.from_file("./tokenizer.json")
def tokenize(
self, text: bytes, add_bos: bool = True, special: bool = False
) -> List[int]:
text = text.decode("utf-8")
return self.tokenizer.encode(text).ids #list[int]
def detokenize(
self,
tokens: List[int],
prev_tokens: Optional[List[int]] = None,
special: bool = False,
) -> bytes:
output= self.tokenizer.decode(tokens)
output = output.replace(" ", "[SPACE]")
output_list = output.split(" ")
output = "".join(output_list)
output = output.replace("[SPACE]", " ")
return output.encode("utf-8")
llm = Hourai2enForGGUF(
model_path="./hourai2-en-37m.gguf",
embedding=False,
verbose=False
)
llm.load_tokenizer()
while True:
input_text = input("入力した文章の続きが生成されます。exitを入力で終了:")
if input_text == "exit":
break
output_text = llm(
input_text,
max_tokens=10, # 生成する最大トークン数
temperature=0.5, # ランダム性(0.0に近づくほど確実な出力、1.0以上で多様化)
top_k=40, # 上位k個の候補に絞り込む
top_p=0.95, # 累積確率p以下の候補に絞り込む
repeat_penalty=1.1, # 同じ単語の繰り返しを抑制するペナルティ
stop=["\n"], # 途中で生成を止めるストップ文字列(リストで複数可)
echo=False
)["choices"][0]["text"]
print(f"入力|出力: {input_text}|{output_text}")Run WariHima/hourai2-en-37m-gguf with guIDE
Download guIDE — the AI-native code editor with local LLM inference and 69 built-in tools.
Source: Hugging Face · Compare models