Instructions to use WariHima/hourai3-ja-toxicity-90m-v1-gguf with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use WariHima/hourai3-ja-toxicity-90m-v1-gguf with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf WariHima/hourai3-ja-toxicity-90m-v1-gguf # Run inference directly in the terminal: llama cli -hf WariHima/hourai3-ja-toxicity-90m-v1-gguf
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf WariHima/hourai3-ja-toxicity-90m-v1-gguf # Run inference directly in the terminal: llama cli -hf WariHima/hourai3-ja-toxicity-90m-v1-gguf
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf WariHima/hourai3-ja-toxicity-90m-v1-gguf # Run inference directly in the terminal: ./llama-cli -hf WariHima/hourai3-ja-toxicity-90m-v1-gguf
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf WariHima/hourai3-ja-toxicity-90m-v1-gguf # Run inference directly in the terminal: ./build/bin/llama-cli -hf WariHima/hourai3-ja-toxicity-90m-v1-gguf
Use Docker
docker model run hf.co/WariHima/hourai3-ja-toxicity-90m-v1-gguf
- LM Studio
- Jan
- Ollama
How to use WariHima/hourai3-ja-toxicity-90m-v1-gguf with Ollama:
ollama run hf.co/WariHima/hourai3-ja-toxicity-90m-v1-gguf
- Unsloth Studio
How to use WariHima/hourai3-ja-toxicity-90m-v1-gguf with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for WariHima/hourai3-ja-toxicity-90m-v1-gguf to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for WariHima/hourai3-ja-toxicity-90m-v1-gguf to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for WariHima/hourai3-ja-toxicity-90m-v1-gguf to start chatting
- Docker Model Runner
How to use WariHima/hourai3-ja-toxicity-90m-v1-gguf with Docker Model Runner:
docker model run hf.co/WariHima/hourai3-ja-toxicity-90m-v1-gguf
- Lemonade
How to use WariHima/hourai3-ja-toxicity-90m-v1-gguf with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull WariHima/hourai3-ja-toxicity-90m-v1-gguf
Run and chat with the model
lemonade run user.hourai3-ja-toxicity-90m-v1-gguf-{{QUANT_TAG}}List all available models
lemonade list
- Atomic Chat
hourai3-ja-toxicity-90m-v1
zenz v3フォーマット 文章加害性評価分類モデル
注意してほしい事。
文章加害性を評価するモデルです。
暴言、性的なコンテンツ、違法性、個人、企業への攻撃が含まれています。
量子かもととなったtensorモデルのリポジトリの./training_codes内のjsonlは使用したデータセットであり、トレーニングコードも公開しています。
意図しない閲覧を避けるため、注意してください。
使用したデータセットLLM-jp Toxicity Datasetより、使用上の注意、禁止事項。
## Intended Use
The dataset is intended to provide a foundation for developing models to detect toxic language in Japanese texts,
enabling researchers and companies to train, validate, and benchmark their models.
This dataset should only be used for ethical and constructive purposes.
Any malicious use,
including but not limited to the creation of harmful or discriminatory content,
is strictly prohibited.
## 日本語訳
使用時に気を付けてほしい事
このデータセットは、日本語テキスト中の有害表現を検出するモデル開発の基盤を提供することを目的としており、
研究者や企業がモデルのトレーニング、検証、ベンチマークを行うことを可能にします。
このデータセットは、倫理的かつ建設的な目的でのみ使用してください。
有害または差別的なコンテンツの作成を含む、いかなる悪意のある使用も固く禁じられています。
architecture:
- lfm2moe
tarined by:
- rtx3060 * 10m training code in ./training_codes
tokenizer from ku-nlp/gpt2-small-japanese-char
+(unused qwen3 special toknes from base model)
+(<nontoxic>トークン、<\toxic>トークン)
加害性が確認された場合は<toxic>、加害性がない、もしくは判定できなかった場合は<nontoxic>を出力します。
<toxic>のあとに加害性タグ
<obscene>, <discriminatory>, <violent>, <illegal>, <personal>, <corporate>, <others>
を出力します。
モデルの出力には誤検知(擬陽性、偽陰性)をする可能性があり、人間の判断を代替するものではないことに、
注意してください。
dataset:
- github ids-cv/wrime use wikipedia part 500 rows 8 epoch
qunat type
- BF16
example code (python)
import llama_cpp
llm = llama_cpp.Llama(
model_path="./hourai3-ja-toxicity-90m-v1.gguf",
embedding=False,
verbose=False
)
while True:
input_text = input("入力した文章の危害性を判定します。exitを入力で終了:")
if input_text == "exit":
break
text = f"<s>\uEE00{input_text}\uEE01"
output_text = llm(
text,
max_tokens=128, # 生成する最大トークン数
temperature=0.0, # ランダム性(0.0に近づくほど確実な出力、1.0以上で多様化)
top_k=40, # 上位k個の候補に絞り込む
top_p=0.95, # 累積確率p以下の候補に絞り込む
repeat_penalty=1.1, # 同じ単語の繰り返しを抑制するペナルティ
stop=[],
echo=False
)["choices"][0]["text"]
print(f"入力|出力: {input_text}|{output_text}")
convert
変換時、qwen3nextがgpt-2トークナイザで使用することを想定されていなかったため、
llama.cppリポジトリのconversion/base.pyファイルの
以下のエラーをバイパスする必要がありました。
1687=1699付近
if res is None:
logger.warning("\n")
logger.warning("**************************************************************************************")
logger.warning("** WARNING: The BPE pre-tokenizer was not recognized!")
logger.warning("** There are 2 possible reasons for this:")
logger.warning("** - the model has not been added to convert_hf_to_gguf_update.py yet")
logger.warning("** - the pre-tokenization config has changed upstream")
logger.warning("** Check your model files and convert_hf_to_gguf_update.py and update them accordingly.")
logger.warning("** ref: https://github.com/ggml-org/llama.cpp/pull/6920")
logger.warning("**")
logger.warning(f"** chkhsh: {chkhsh}")
logger.warning("**************************************************************************************")
logger.warning("\n")
return "default"
#raise NotImplementedError("BPE pre-tokenizer was not recognized - update get_vocab_base_pre()")
想定されていないことによる変換時のエラーなので、推論時はmainstreamのllama.cppで動作します。
入力例
以下をクリックすると、差別的、暴力的、性的表現の含まれる入力例が表示されます。
【クリックして入力例を表示】
input_text "キチガイの外国人は殺せ"
output_text "<toxic><discriminatory>"
input_text "エッチな電話、ぴちぴち70 代と今すぐ合おう"
output_text "<toxic><obscene>"
入力テキストのフォーマット = f"<s>\uEE00{input_text}\uEE01"
感情トークン( <objective>か<subjective>) を出力します。
- Downloads last month
- 45
We're not able to determine the quantization variants.
Model tree for WariHima/hourai3-ja-toxicity-90m-v1-gguf
Base model
WariHima/hourai3-90m-base-ja-v1