Instructions to use jinparkdev/lora_gemma4_e2b_calm_debate_korean with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use jinparkdev/lora_gemma4_e2b_calm_debate_korean with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("google/gemma-4-E2B") model = PeftModel.from_pretrained(base_model, "jinparkdev/lora_gemma4_e2b_calm_debate_korean") - Transformers
How to use jinparkdev/lora_gemma4_e2b_calm_debate_korean with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="jinparkdev/lora_gemma4_e2b_calm_debate_korean")# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("jinparkdev/lora_gemma4_e2b_calm_debate_korean", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use jinparkdev/lora_gemma4_e2b_calm_debate_korean with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "jinparkdev/lora_gemma4_e2b_calm_debate_korean" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "jinparkdev/lora_gemma4_e2b_calm_debate_korean", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/jinparkdev/lora_gemma4_e2b_calm_debate_korean
- SGLang
How to use jinparkdev/lora_gemma4_e2b_calm_debate_korean with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "jinparkdev/lora_gemma4_e2b_calm_debate_korean" \ --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": "jinparkdev/lora_gemma4_e2b_calm_debate_korean", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
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 "jinparkdev/lora_gemma4_e2b_calm_debate_korean" \ --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": "jinparkdev/lora_gemma4_e2b_calm_debate_korean", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use jinparkdev/lora_gemma4_e2b_calm_debate_korean with Docker Model Runner:
docker model run hf.co/jinparkdev/lora_gemma4_e2b_calm_debate_korean
lora_gemma4_e2b_calm_debate_korean
This repository contains a PEFT LoRA adapter trained from the base model google/gemma-4-E2B.
The adapter was instruction-tuned to follow the persona_card.md description:
๋น์ ์ '์นจ์ฐฉ๋งจํ ํ ๋ก ๊ฐ'์ ๋๋ค. 40๋ ์ ์ง ์นํฐ ์๊ฐ์ด์ ์ธํฐ๋ท ๋ฐฉ์ก์ธ ์ถ์ ์ผ๋ก, ์ ์ํ์ง ์๊ณ ํ ๋ฐ ๋จ์ด์ ธ ๋ ผ์ ์ ๋ฏ์ด๋ด ๋๋ค.
It is designed to produce Korean debate rebuttals that first summarize the opponent's claim, question the hidden premise, use everyday analogies, and return to the core issue without ending in passive agreement.
Persona Card Summary
- ๋ณต์กํ ๋ ผ์์ ๋ฐ์ด๋ถ์ด๊ธฐ๋ณด๋ค "๊ทผ๋ฐ ์ด๊ฒ ์ ์ด๋ ๊ฒ ๋ ๊ฑฐ์ง?"๋ผ๋ ์์ ์ผ๋ก ๊ตฌ์กฐ๋ฅผ ์ ๊ฒํฉ๋๋ค.
- ์๋ ์ฃผ์ฅ์ ๋จผ์ "๊ทธ๋ฌ๋๊น ์ง๊ธ ๋ง์ ์ด๋ฐ ๊ฑฐ์์์"๋ก ์ ๋ฆฌํ ๋ค, ๋น์ฐํด ๋ณด์ด๋ ์ ์ ๋ฅผ ๋๋ฌป์ต๋๋ค.
- ์ด๋ ค์ด ์ฉ์ด ๋์ ์ผ์ ๋น์ (์์, ๊ฒ์, ์ฅ์ฌ, ์น๊ตฌ๊ด๊ณ, ๋ฐฉ์ก, ๋งํ/์ฝํฐ)๋ฅผ ์ฌ์ฉํฉ๋๋ค.
- ์ ์ ๊ณต๊ฒฉ๋ณด๋ค "๊ทธ๊ฑด ์ข...", "์๊ฐํด๋ณด๋ฉด ์ด์ํ์์์"์ฒ๋ผ ํ์ ๋นผ๊ณ ์ฐ๋ฅด๋ ๋ฐ๋ฐ์ ์ ํธํฉ๋๋ค.
- ๋น์ ๋ ํ ์๋ต์ 1-2๊ฐ๋ก ์ ํํ๊ณ , ๋ฐ๋์ ํต์ฌ ๋ ผ์ ์ผ๋ก ๋์์ต๋๋ค.
- ๋ง๋ฌด๋ฆฌ๋ "๊ฒฐ๊ตญ ํต์ฌ์ ์ด๊ฑฐ์์."๋ก ์งง๊ฒ ์ ๋ฆฌํ๋, ๋์๋ก ๋๋ด์ง ์์ต๋๋ค.
Speaking Style
- ์์: "์๋ ๊ทผ๋ฐ", "์ด๊ฒ ์ข ์๊ธด ๊ฒ", "์๊ฐํด๋ณด๋ฉด ์ด์ํ์์์"
- ์ ๋ฆฌ: "๊ทธ๋ฌ๋๊น ์ง๊ธ ๋ง์"
- ๋น์ ๋์ : "๋น์ ํ์๋ฉด"
- ๊ฒฐ๋ก : "๊ฒฐ๊ตญ ํต์ฌ์ ์ด๊ฑฐ์์", "๋๋ฌด ์ด๋ ต๊ฒ ๊ฐ ํ์ ์์ด์"
- ํ๋ฆ: ์ ๋ฆฌ -> ๋๋ฌป๊ธฐ -> ๋น์ -> ๋ฐ๋ก -> ๊ฒฐ๋ก
- ๋ต๋ณ ๊ธธ์ด ๋ชฉํ: 120-260์
Base Model
- Base checkpoint:
google/gemma-4-E2B - This is a LoRA adapter, not a merged full model.
- The project uses the base model rather than an instruction-tuned checkpoint.
Training
- Method: QLoRA supervised fine-tuning
- Trainer: TRL
SFTTrainer - Dataset size: 5,634 chat-style instruction examples
- LoRA rank: 16
- LoRA alpha: 32
- LoRA dropout: 0.05
- Target modules: all linear modules
- Max sequence length: 1536
Files
adapter_model.safetensors: LoRA adapter weightsadapter_config.json: PEFT adapter configurationtokenizer.json,tokenizer_config.json: tokenizer filespersona_card.md: target persona and style guidereport.md: project report
Usage
import torch
from peft import PeftModel
from transformers import AutoModelForCausalLM, AutoTokenizer
base_model = "google/gemma-4-E2B"
adapter = "YOUR_USERNAME/lora_gemma4_e2b_calm_debate_korean"
tokenizer = AutoTokenizer.from_pretrained(adapter)
model = AutoModelForCausalLM.from_pretrained(
base_model,
device_map="auto",
torch_dtype=torch.float16,
)
model = PeftModel.from_pretrained(model, adapter)
model.eval()
messages = [
{
"role": "system",
"content": (
"๋น์ ์ '์นจ์ฐฉ๋งจํ ํ ๋ก ๊ฐ'์
๋๋ค. 40๋ ์ ์ง ์นํฐ ์๊ฐ์ด์ ์ธํฐ๋ท ๋ฐฉ์ก์ธ ์ถ์ ์ผ๋ก, "
"์ ์ํ์ง ์๊ณ ํ ๋ฐ ๋จ์ด์ ธ ๋
ผ์ ์ ๋ฏ์ด๋ด
๋๋ค. ์๋ ์ฃผ์ฅ์ ๋จผ์ "
"'๊ทธ๋ฌ๋๊น ์ง๊ธ ๋ง์ ์ด๋ฐ ๊ฑฐ์์์'๋ก ์ ๋ฆฌํ ๋ค, ๋น์ฐํด ๋ณด์ด๋ ์ ์ ๋ฅผ ๋๋ฌป์ต๋๋ค. "
"์ด๋ ค์ด ์ฉ์ด ๋์ ์ผ์ ๋น์ ๋ฅผ ์ฌ์ฉํ๊ณ , ๋ง๋ฌด๋ฆฌ๋ '๊ฒฐ๊ตญ ํต์ฌ์ ์ด๊ฑฐ์์.'๋ก "
"์งง๊ฒ ์ ๋ฆฌํ๋ ๋์๋ก ๋๋ด์ง ์์ต๋๋ค."
),
},
{
"role": "user",
"content": "ํ ๋ก ์ฃผ์ : ๋
ธํค์ฆ์กด์ ํฉ๋ฒ์ผ๋ก ์ธ์ ํด์ผ ํ๋๊ฐ\n์๋ ์ฃผ์ฅ: ์์
์ ์์ ๋ฅผ ์ํด ์
์ฃผ๊ฐ ์ ํํ ๊ถ๋ฆฌ๊ฐ ์ฐ์ ์ด๋ค.",
},
]
if getattr(tokenizer, "chat_template", None):
prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
else:
prompt = "\n\n".join(f"{m['role'].upper()}:\n{m['content']}" for m in messages) + "\n\nASSISTANT:\n"
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
with torch.no_grad():
outputs = model.generate(
**inputs,
max_new_tokens=220,
temperature=0.6,
top_p=0.9,
do_sample=True,
pad_token_id=tokenizer.eos_token_id,
)
print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:], skip_special_tokens=True))
Limitations
The model was trained for a stylized Korean debate persona. It should not be treated as a factual authority, legal advisor, or safety-critical decision system. Some training examples are longer than the persona card's preferred length, so generated responses may sometimes exceed the ideal short-response style.
Framework Versions
- PEFT 0.19.1
- TRL: 1.3.0
- Transformers: 5.8.0
- Pytorch: 2.5.1+cu118
- Datasets: 4.8.5
- Tokenizers: 0.22.2
- Downloads last month
- 7
Model tree for jinparkdev/lora_gemma4_e2b_calm_debate_korean
Base model
google/gemma-4-E2B