tellang/yeji-fortune-telling-ko-v9
Viewer • Updated • 63.3k • 65
How to use tellang/yeji-4b-instruct-v9-AWQ with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="tellang/yeji-4b-instruct-v9-AWQ")
messages = [
{"role": "user", "content": "Who are you?"},
]
pipe(messages) # Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("tellang/yeji-4b-instruct-v9-AWQ")
model = AutoModelForCausalLM.from_pretrained("tellang/yeji-4b-instruct-v9-AWQ")
messages = [
{"role": "user", "content": "Who are you?"},
]
inputs = tokenizer.apply_chat_template(
messages,
add_generation_prompt=True,
tokenize=True,
return_dict=True,
return_tensors="pt",
).to(model.device)
outputs = model.generate(**inputs, max_new_tokens=40)
print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:]))How to use tellang/yeji-4b-instruct-v9-AWQ with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "tellang/yeji-4b-instruct-v9-AWQ"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "tellang/yeji-4b-instruct-v9-AWQ",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'docker model run hf.co/tellang/yeji-4b-instruct-v9-AWQ
How to use tellang/yeji-4b-instruct-v9-AWQ with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "tellang/yeji-4b-instruct-v9-AWQ" \
--host 0.0.0.0 \
--port 30000
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:30000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "tellang/yeji-4b-instruct-v9-AWQ",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'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 "tellang/yeji-4b-instruct-v9-AWQ" \
--host 0.0.0.0 \
--port 30000
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:30000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "tellang/yeji-4b-instruct-v9-AWQ",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'How to use tellang/yeji-4b-instruct-v9-AWQ with Docker Model Runner:
docker model run hf.co/tellang/yeji-4b-instruct-v9-AWQ
yeji-4b-instruct-v9의 AWQ 4-bit 양자화 버전. vLLM 프로덕션 서빙에 최적화.
YEJI는 사주(四柱), 서양 점성술, 타로, 화투 4개 도메인에 특화된 한국어 LLM입니다. 이 모델은 원본 v9 모델을 AWQ (Activation-aware Weight Quantization) 4-bit로 양자화한 버전입니다.
| Parameter | Value |
|---|---|
| Method | AWQ (Activation-aware Weight Quantization) |
| Bits | 4 |
| Group Size | 128 |
| Original Size | ~8 GB |
| Quantized Size | ~2.5 GB |
| VRAM Required | ~3 GB |
python -m vllm.entrypoints.openai.api_server \
--model tellang/yeji-4b-instruct-v9-AWQ \
--quantization awq \
--max-model-len 4096
from transformers import AutoModelForCausalLM, AutoTokenizer
model_name = "tellang/yeji-4b-instruct-v9-AWQ"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(model_name, torch_dtype="auto", device_map="auto")
messages = [
{"role": "system", "content": "당신은 전문 타로 상담사입니다."},
{"role": "user", "content": "오늘의 원카드 타로 리딩을 해주세요."}
]
text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer(text, return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, max_new_tokens=512, temperature=0.7)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
| Format | Model | Use Case |
|---|---|---|
| Full (FP16) | yeji-4b-instruct-v9 | 학습, 고정밀 추론 |
| MLX 4-bit | yeji-4b-instruct-v9-mlx-4bit | Apple Silicon |
| GGUF | yeji-4b-gguf | llama.cpp, Ollama |