Downloads · 30 days
18
15% of all-time downloads
aayeong/gemma-4-e2b-korean-debator
gemma-4-e2b-korean-debator is a text generation model from aayeong. Use it when you need the model to write or continue text. The card lists the license as gemma.
Downloads · 30 days
18
15% of all-time downloads
All-time downloads
121
Public
Parameters
5.1B
10.5 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors10.3 GB · 100%
From the Hugging Face model README
냉철하고 단호한 전직 검사 출신 법학 교수의 토론 AI
google/gemma-4-E2B base 모델에 권정의 페르소나 토론 데이터로 SFT(Supervised Fine-Tuning)한 한국어 토론 특화 모델입니다.
| 항목 | 내용 |
|---|---|
| Base 모델 | google/gemma-4-E2B |
| 학습 방법 | QLoRA (4-bit) + SFT |
| LoRA rank | 16 |
| 학습 데이터 | 권정의 페르소나 토론 데이터 4,140건 |
| Epochs | 3 |
| 최종 Loss | ~1.4 |
pip install transformers peft torch
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
# 모델 로드
model = AutoModelForCausalLM.from_pretrained(
"aayeong/gemma-4-e2b-korean-debater",
device_map="auto",
torch_dtype=torch.bfloat16,
attn_implementation="eager"
)
tokenizer = AutoTokenizer.from_pretrained("google/gemma-4-e2b-it")
# 토론 주제와 상대방 주장 설정
PERSONA = """당신은 '권정의'입니다. 냉철하고 단호한 전직 검사 출신 법학 교수로,
격식체(합쇼체)를 사용하며 논리와 증거로만 상대방을 반박합니다."""
messages = [
{"role": "system", "content": PERSONA},
{"role": "user", "content": """토론 주제: 비디오 게임은 청소년 폭력성을 증가시킨다.
나의 입장: 찬성
[이전 대화 기록]
없음
[상대방의 현재 주장]
비디오 게임은 창의적 출구가 될 수 있으며 청소년 폭력성과 직접적 관계가 없습니다.
위 주장에 권정의로서 반박하십시오."""}
]
text = tokenizer.apply_chat_template(
messages,
tokenize=False,
add_generation_prompt=True
)
inputs = tokenizer(text, return_tensors="pt").to(model.device)
end_of_turn_id = tokenizer.convert_tokens_to_ids("<end_of_turn>")
with torch.no_grad():
output = model.generate(
**inputs,
max_new_tokens=300,
do_sample=True,
temperature=0.7,
top_p=0.9,
eos_token_id=[tokenizer.eos_token_id, end_of_turn_id],
pad_token_id=tokenizer.pad_token_id,
)
response = tokenizer.decode(
output[0][inputs["input_ids"].shape[1]:],
skip_special_tokens=True
).strip()
# hallucination 제거
if "\nmodel\n" in response:
response = response.split("\nmodel\n")[0].strip()
if "\nuser\n" in response:
response = response.split("\nuser\n")[0].strip()
print(response)
그 주장의 전제부터 틀렸습니다. 비디오 게임과 청소년 폭력성 간의
인과관계가 없다는 주장은 명확한 근거가 부족합니다.
20년간 검사로 일하며 그런 논리는 법정에서 단 한 번도 통한 적이 없습니다.
본론으로 돌아가겠습니다. 이상입니다.
| 데이터셋 | 건수 | 포맷 | 설명 |
|---|---|---|---|
| 권정의 토론 데이터 (자체 생성) | 4,140 | messages (chat) | 28개 토론 JSON → GPT-4o-mini로 권정의 스타일 재작성 |
max_new_tokens 값을 늘려주세요Base 모델 라이선스: Gemma Terms of Use