tellang/yeji-fortune-telling-ko-v3
Viewer • Updated • 35.6k • 10
How to use tellang/yeji-4b-rslora-v7 with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="tellang/yeji-4b-rslora-v7")
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-v7")
model = AutoModelForCausalLM.from_pretrained("tellang/yeji-4b-rslora-v7", 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-v7 with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "tellang/yeji-4b-rslora-v7"
# 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-v7",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'docker model run hf.co/tellang/yeji-4b-rslora-v7
How to use tellang/yeji-4b-rslora-v7 with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "tellang/yeji-4b-rslora-v7" \
--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-v7",
"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-v7" \
--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-v7",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'How to use tellang/yeji-4b-rslora-v7 with Docker Model Runner:
docker model run hf.co/tellang/yeji-4b-rslora-v7
Qwen3-4B 기반의 한국어 운세 생성 전문 모델입니다. rsLoRA 기법을 사용하여 사주, 타로, 별자리 등 다양한 운세 도메인에 대해 파인튜닝되었습니다.
이 모델은 SSAFY 14기 YEJI 팀에서 개발한 AI 기반 운세 서비스를 위해 제작되었습니다. 33,000건 이상의 한국어 운세 데이터셋으로 학습되었으며, 동양 운세(사주), 서양 운세(타로, 별자리), 티키타카 대화 형식을 지원합니다.
/no_think 포함 (Qwen3 thinking mode 비활성화)동양 운세 (Eastern Fortune)
서양 운세 (Western Fortune)
티키타카 대화 (Chat)
| 항목 | 값 |
|---|---|
| Base Model | Qwen/Qwen3-4B |
| 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-v7",
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
)
# 프롬프트 구성
system_prompt = "/no_think\n당신은 전문 운세 상담가입니다."
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-v7"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(
model_name,
torch_dtype=torch.float16,
device_map="auto"
)
# 프롬프트 구성
system_prompt = "/no_think\n당신은 전문 운세 상담가입니다."
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)
/no_think
당신은 전문 운세 상담가입니다. 사용자의 생년월일, 시간, 질문 유형을 바탕으로 정확하고 공감적인 운세를 제공합니다.
출력 형식:
- JSON 구조화 출력 (Pydantic 스키마 준수)
- 키워드 3개 (긍정/부정/중립)
- 상세 해석
- 조언 및 주의사항
messages = [
{"role": "system", "content": "/no_think\n당신은 전문 운세 상담가입니다."},
{"role": "user", "content": """
사용자 정보:
- 생년월일: 1990년 5월 15일
- 생시: 14시 30분
- 성별: 여성
- 질문 유형: 연애운
사주 정보:
- 일주: 갑인일주
- 오행: 목(3), 화(2), 토(1), 금(1), 수(1)
- 신살: 도화살
오늘의 연애운을 JSON 형식으로 알려주세요.
"""}
]
messages = [
{"role": "system", "content": "/no_think\n당신은 전문 타로 리더입니다."},
{"role": "user", "content": """
타로 스프레드:
1. 과거: 컵 에이스 (정방향)
2. 현재: 검 5 (역방향)
3. 미래: 별 (정방향)
질문: 이번 달 사랑운은 어떤가요?
JSON 형식으로 해석해주세요.
"""}
]
| 평가 지표 | 값 |
|---|---|
| Training Loss | 0.2547 (epoch 5) |
| Validation Loss | 0.3124 |
| BLEU Score | 42.3 |
| ROUGE-L | 0.58 |
| JSON Validity | 98.2% |
/no_think 시스템 프롬프트<think> 태그 출력 경향 → /no_think 프롬프트로 완화Apache License 2.0
@misc{yeji-4b-rslora-v7,
author = {SSAFY 14th YEJI Team},
title = {YEJI 4B rsLoRA v7: Korean Fortune-Telling Language Model},
year = {2025},
publisher = {HuggingFace},
url = {https://huggingface.co/tellang/yeji-4b-rslora-v7}
}
질문이나 문제 발생 시 GitHub Issues를 통해 문의해주세요.