fn-aka-mur/wiki40b_ja
Viewer • Updated • 828k • 147 • 4
How to use iamtatsuki05/Llama-JP-0.5B-PT-stage2 with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="iamtatsuki05/Llama-JP-0.5B-PT-stage2") # Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("iamtatsuki05/Llama-JP-0.5B-PT-stage2")
model = AutoModelForCausalLM.from_pretrained("iamtatsuki05/Llama-JP-0.5B-PT-stage2")How to use iamtatsuki05/Llama-JP-0.5B-PT-stage2 with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "iamtatsuki05/Llama-JP-0.5B-PT-stage2"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "iamtatsuki05/Llama-JP-0.5B-PT-stage2",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'docker model run hf.co/iamtatsuki05/Llama-JP-0.5B-PT-stage2
How to use iamtatsuki05/Llama-JP-0.5B-PT-stage2 with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "iamtatsuki05/Llama-JP-0.5B-PT-stage2" \
--host 0.0.0.0 \
--port 30000
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:30000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "iamtatsuki05/Llama-JP-0.5B-PT-stage2",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'docker run --gpus all \
--shm-size 32g \
-p 30000:30000 \
-v ~/.cache/huggingface:/root/.cache/huggingface \
--env "HF_TOKEN=<secret>" \
--ipc=host \
lmsysorg/sglang:latest \
python3 -m sglang.launch_server \
--model-path "iamtatsuki05/Llama-JP-0.5B-PT-stage2" \
--host 0.0.0.0 \
--port 30000
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:30000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "iamtatsuki05/Llama-JP-0.5B-PT-stage2",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'How to use iamtatsuki05/Llama-JP-0.5B-PT-stage2 with Docker Model Runner:
docker model run hf.co/iamtatsuki05/Llama-JP-0.5B-PT-stage2
English / Japanese
Llama-JP-0.5B-PT-stage2 extends iamtatsuki05/Llama-JP-0.5B-PT-stage1 with additional training on fujiki/wiki40b_ja. The model observes roughly 1B tokens with 8,192-token contexts to strengthen long-form Japanese generation and encyclopedic coverage.
transformers>=4.51.0
accelerate>=1.6.0
sentencepiece>=0.2.0
flash-attn>=2.7.3
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
model_name = "iamtatsuki05/Llama-JP-0.5B-PT-stage2"
model_kwargs = {
"torch_dtype": torch.bfloat16,
"attn_implementation": "flash_attention_2",
"device_map": "auto",
}
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(model_name, **model_kwargs)
prompt = "ちいかわのハチワレは"
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
output = model.generate(
**inputs,
max_new_tokens=256,
temperature=0.8,
top_p=0.9,
do_sample=True,
)
print(tokenizer.decode(output[0], skip_special_tokens=True))
These checkpoints were further pre-trained on fujiki/wiki40b_ja for roughly 1B tokens with 8,192-token contexts to enhance encyclopedic coverage.
| ID | Architecture | #Param. | #Param. w/o Emb. |
JGLUE-Avg | JGLUE-JSTS | JGLUE-JNLI | JGLUE-JCoLA |
|---|---|---|---|---|---|---|---|
| iamtatsuki05/ModernBERT-JP-0.5B-PT-stage2 | ModernBERT | 679M | 548M | 86.32 | 89.29 | 86.68 | 83.00 |
| iamtatsuki05/Llama-JP-0.5B-PT-stage2 (this model) |
Llama | 661M | 530M | 81.88 | 82.91 | 78.67 | 84.06 |
This model is distributed under the MIT License.
@article{MIREI
title={同一条件下における Encoder/Decoder アーキテクチャによる文埋め込みの性能分析},
author={岡田 龍樹 and 杉本 徹},
journal={言語処理学会第 32 回年次大会 (NLP2026)},
year={2026}
}