Downloads · 30 days
13
19% of all-time downloads
hyun7120/chim-style-debate-gemma4-e2b-lora-v1
chim-style-debate-gemma4-e2b-lora-v1 is a text generation model from hyun7120. Use it when you need the model to write or continue text. It is set up for peft. The card lists the license as gemma.
This repository contains a LoRA adapter fine-tuned from the base model google/gemma-4-E2B for Korean debate-style responses.
Downloads · 30 days
13
19% of all-time downloads
All-time downloads
67
Public
Repo size
129 MB
Likes
0
Public
Click a slice to open those files.
.safetensors96.7 MB · 75%
From the Hugging Face model README
This repository contains a LoRA adapter fine-tuned from the base model google/gemma-4-E2B for Korean debate-style responses.
This is an adapter-only repository. The adapter does not behave like a fully packaged chat application by itself. For the intended style, load all three parts together:
google/gemma-4-E2Bpersona_system_prompt.txt and chat_template.jinjaIf you load the adapter without the persona system prompt, the output can look generic and may not strongly show the intended Korean debate persona.
This is a v1 / legacy comparison adapter. It was trained before the later v3_relative prompt correction, so it should be treated as a baseline or backup artifact rather than the final recommended adapter.
Known v1 limitation:
v3_relative adapter is being trained separately to make rebuttal direction depend on the actual previous user utterance.Use this adapter only with:
google/gemma-4-E2B
This project intentionally uses the base Gemma 4 E2B model, not an instruction-tuned variant.
from pathlib import Path
import torch
from peft import PeftModel
from transformers import AutoModelForImageTextToText, AutoProcessor
base_model_id = "google/gemma-4-E2B"
adapter_id = "hyun7120/chim-style-debate-gemma4-e2b-lora-v1"
processor = AutoProcessor.from_pretrained(base_model_id)
model = AutoModelForImageTextToText.from_pretrained(
base_model_id,
device_map="auto",
dtype=torch.bfloat16,
)
model = PeftModel.from_pretrained(model, adapter_id)
model.eval()
# You can also read these from the repository files after downloading them.
with open("persona_system_prompt.txt", "r", encoding="utf-8") as f:
persona_system_prompt = f.read().strip()
with open("chat_template.jinja", "r", encoding="utf-8") as f:
processor.chat_template = f.read()
messages = [
{"role": "system", "content": persona_system_prompt},
{"role": "user", "content": "?? ??: ?? ??? ???? ?? ???? ??? ???
?? ??: ?? ???? ??? ??? ?? ??? ??????.
? ?? ??? ??? ???."},
]
text = processor.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = processor(text=text, text_kwargs={"return_tensors": "pt"}).to(model.device)
turn_eot = processor.tokenizer.convert_tokens_to_ids("<turn|>")
eos_ids = [processor.tokenizer.eos_token_id, turn_eot]
with torch.no_grad():
output = model.generate(
**inputs,
max_new_tokens=180,
do_sample=True,
temperature=0.65,
top_p=0.90,
top_k=50,
eos_token_id=eos_ids,
pad_token_id=processor.tokenizer.eos_token_id,
)
answer = processor.decode(output[0][inputs["input_ids"].shape[-1]:], skip_special_tokens=False)
print(answer.split("<turn|>")[0].strip())
For a more complete example, see inference_example.py.
adapter_model.safetensorsadapter_config.jsonpersona_system_prompt.txtchat_template.jinjainference_example.py