tellang/yeji-fortune-telling-ko-v3
Viewer • Updated • 35.6k • 8
How to use tellang/yeji-4b-rslora-v8 with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="tellang/yeji-4b-rslora-v8")
messages = [
{"role": "user", "content": "Who are you?"},
]
pipe(messages) # Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("tellang/yeji-4b-rslora-v8")
model = AutoModelForCausalLM.from_pretrained("tellang/yeji-4b-rslora-v8", device_map="auto")
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-rslora-v8 with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "tellang/yeji-4b-rslora-v8"
# 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-rslora-v8",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'docker model run hf.co/tellang/yeji-4b-rslora-v8
How to use tellang/yeji-4b-rslora-v8 with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "tellang/yeji-4b-rslora-v8" \
--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-rslora-v8",
"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-rslora-v8" \
--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-rslora-v8",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'How to use tellang/yeji-4b-rslora-v8 with Docker Model Runner:
docker model run hf.co/tellang/yeji-4b-rslora-v8
Qwen3-4B-Instruct-2507 (Non-thinking Only) 기반의 한국어 운세 생성 전문 모델입니다. v7의 <think> 태그 출력 문제를 해결하기 위해 thinking 기능이 비활성화된 베이스 모델로 재학습되었습니다.
이 모델은 v7의 개선 버전으로, Qwen3-4B-Instruct-2507 Non-thinking Only 베이스를 사용하여 불필요한 사고 과정 출력을 완전히 제거했습니다. 33,000건 이상의 한국어 운세 데이터셋으로 학습되었으며, 동양 운세(사주), 서양 운세(타로, 별자리), 티키타카 대화 형식을 지원합니다.
<think> 태그 출력 완전 제거: 2507 Instruct (Non-thinking Only) 베이스 사용/no_think 불필요 (베이스 자체가 non-thinking)동양 운세 (Eastern Fortune)
서양 운세 (Western Fortune)
티키타카 대화 (Chat)
| 항목 | 값 |
|---|---|
| Base Model | Qwen/Qwen3-4B-Instruct-2507 (Non-thinking Only) |
| Fine-tuning Method | rsLoRA (Rank-Stabilized LoRA) |
| LoRA Rank (r) | 64 |
| LoRA Alpha | 128 |
| Target Modules | q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj |
| Dataset | tellang/yeji-fortune-telling-ko-v3 |
| Dataset Size | 33,528 samples |
| Training Epochs | 5 |
| Learning Rate | 5e-5 |
| Batch Size | 8 (per device) |
| Gradient Accumulation Steps | 4 |
| Effective Batch Size | 32 |
| Max Sequence Length | 4096 |
| Optimizer | AdamW |
| LR Scheduler | Cosine with warmup |
| Warmup Ratio | 0.1 |
| Weight Decay | 0.01 |
from vllm import LLM, SamplingParams
# 모델 로드
llm = LLM(
model="tellang/yeji-4b-rslora-v8",
trust_remote_code=True,
max_model_len=4096,
dtype="auto"
)
# 샘플링 파라미터
sampling_params = SamplingParams(
temperature=0.7,
top_p=0.9,
max_tokens=2048,
repetition_penalty=1.1
)
# 프롬프트 구성 (v8은 /no_think 불필요)
system_prompt = "당신은 전문 운세 상담가입니다."
user_message = "오늘의 연애운을 알려주세요."
messages = [
{"role": "system", "content": system_prompt},
{"role": "user", "content": user_message}
]
# 추론 실행
outputs = llm.chat(
messages=messages,
sampling_params=sampling_params
)
print(outputs[0].outputs[0].text)
from transformers import AutoTokenizer, AutoModelForCausalLM
import torch
# 모델 및 토크나이저 로드
model_name = "tellang/yeji-4b-rslora-v8"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(
model_name,
torch_dtype=torch.float16,
device_map="auto"
)
# 프롬프트 구성
system_prompt = "당신은 전문 운세 상담가입니다."
user_message = "오늘의 연애운을 알려주세요."
messages = [
{"role": "system", "content": system_prompt},
{"role": "user", "content": user_message}
]
# 토크나이징
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=2048,
temperature=0.7,
top_p=0.9,
repetition_penalty=1.1,
do_sample=True
)
response = tokenizer.decode(outputs[0][len(inputs.input_ids[0]):], skip_special_tokens=True)
print(response)
당신은 전문 운세 상담가입니다. 사용자의 생년월일, 시간, 질문 유형을 바탕으로 정확하고 공감적인 운세를 제공합니다.
출력 형식:
- JSON 구조화 출력 (Pydantic 스키마 준수)
- 키워드 3개 (긍정/부정/중립)
- 상세 해석
- 조언 및 주의사항
참고: v8은 /no_think 프롬프트가 불필요합니다. 베이스 모델 자체가 non-thinking입니다.
messages = [
{"role": "system", "content": "당신은 전문 운세 상담가입니다."},
{"role": "user", "content": """
사용자 정보:
- 생년월일: 1990년 5월 15일
- 생시: 14시 30분
- 성별: 여성
- 질문 유형: 연애운
사주 정보:
- 일주: 갑인일주
- 오행: 목(3), 화(2), 토(1), 금(1), 수(1)
- 신살: 도화살
오늘의 연애운을 JSON 형식으로 알려주세요.
"""}
]
messages = [
{"role": "system", "content": "당신은 전문 타로 리더입니다."},
{"role": "user", "content": """
타로 스프레드:
1. 과거: 컵 에이스 (정방향)
2. 현재: 검 5 (역방향)
3. 미래: 별 (정방향)
질문: 이번 달 사랑운은 어떤가요?
JSON 형식으로 해석해주세요.
"""}
]
| 평가 지표 | v7 | v8 (개선) |
|---|---|---|
| Training Loss (epoch 5) | 0.2547 | 0.2381 |
| Validation Loss | 0.3124 | 0.2956 |
| BLEU Score | 42.3 | 44.7 |
| ROUGE-L | 0.58 | 0.61 |
| JSON Validity | 98.2% | 99.6% ⬆️ |
<think> Tag Leakage |
3.2% | 0.0% ✅ |
| 측면 | v7 | v8 |
|---|---|---|
| Base Model | Qwen3-4B | Qwen3-4B-Instruct-2507 (Non-thinking) |
| Thinking Mode | /no_think 프롬프트 필요 |
✅ 베이스 자체가 non-thinking |
<think> 출력 |
3.2% 발생 | ✅ 0.0% (완전 제거) |
| JSON 유효성 | 98.2% | ✅ 99.6% |
| 추론 속도 | 기준선 | ✅ ~10% 더 빠름 |
| 프롬프트 복잡도 | 높음 (/no_think 필수) |
✅ 낮음 (불필요) |
<think> 태그 완전 제거/no_think 시스템 프롬프트Apache License 2.0
@misc{yeji-4b-rslora-v8,
author = {SSAFY 14th YEJI Team},
title = {YEJI 4B rsLoRA v8: Korean Fortune-Telling Language Model (No-Thinking Optimized)},
year = {2025},
publisher = {HuggingFace},
url = {https://huggingface.co/tellang/yeji-4b-rslora-v8}
}
질문이나 문제 발생 시 GitHub Issues를 통해 문의해주세요.