File size: 3,202 Bytes
d67eb76
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
---
license: other
license_name: exaone
license_link: LICENSE
datasets:
- huggingface-KREW/korean-role-playing
language:
- ko
base_model:
- LGAI-EXAONE/EXAONE-3.5-2.4B-Instruct
tags:
- exaone
- role-playing
---
# EXAGIRL-2.4B-Instruct

<img src="https://huggingface.co/huggingface-KREW/EXAGIRL-2.4B-Instruct/resolve/main/exagirl-logo.png" alt="EXAGIRL Logo" width="400"/>

## 👀 모델 소개

**EXAGIRL-2.4B-Instruct**는 LG AI Research의 [EXAONE-3.5-2.4B-Instruct](https://huggingface.co/LGAI-EXAONE/EXAONE-3.5-2.4B-Instruct) 모델을 기반으로, **한국어 롤플레잉 대화**에 특화되도록 미세조정한 LoRA 기반 모델입니다.  
우리의 친구 '엑사'는 다양한 페르소나와 상황에 맞춰 자연스럽고 재미있는 대화를 할 수 있도록 만들어졌습니다.

> 아직 학습이 제대로 되지 않은 pre-release 상태입니다

## 🧪 학습 정보

- **Base model**: [LGAI-EXAONE/EXAONE-3.5-2.4B-Instruct](https://huggingface.co/LGAI-EXAONE/EXAONE-3.5-2.4B-Instruct)
- **Training strategy**: LoRA (Low-Rank Adaptation)
- **learning rate**: 4e-5
- **Dataset**:
  - [`gf-persona-data`](https://huggingface.co/datasets/huggingface-KREW/korean-role-playing) (1 epoch)
  - [`exa-data`](https://huggingface.co/datasets/huggingface-KREW/korean-role-playing) (2 epoch)
- **지원 언어**: 한국어 전용

## 🗃️ 데이터셋 설명

이 모델은 [huggingface-KREW/korean-role-playing](https://huggingface.co/datasets/huggingface-KREW/korean-role-playing)에 포함된 다음의 서브셋으로 학습되었습니다:

- [`gf-persona-data`](https://github.com/Pseudo-Lab/Hugging-Face-Hub-Garden/discussions/31): 연인 간의 페르소나 기반 역할극 대화 데이터셋입니다.
- [`exa-data`](https://github.com/Pseudo-Lab/Hugging-Face-Hub-Garden/discussions/30): 엑사(EXA) 세계관 기반 페르소나를 가진 캐릭터의 감정 표현과 행동 지시 대화가 포함되어 있습니다.

## 🧑‍💻 사용 예시

```python
from transformers import AutoTokenizer, AutoModelForCausalLM

model_name = "huggingface-KREW/EXAGIRL-2.4B-Instruct"

# Tokenizer & Model 불러오기
tokenizer = AutoTokenizer.from_pretrained(model_name, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(
    model_name,
    torch_dtype="auto",  # 또는 torch.bfloat16
    trust_remote_code=True,
    device_map="auto"
)

# 대화 프롬프트 구성
messages = [
    {"role": "user", "content": "엑사야 뭐하고있니?"}
]

# Chat 템플릿 적용
input_ids = tokenizer.apply_chat_template(
    messages,
    tokenize=True,
    add_generation_prompt=True,
    return_tensors="pt"
)

# 응답 생성
output = model.generate(
    input_ids.to(model.device),
    eos_token_id=tokenizer.eos_token_id,
    max_new_tokens=128,
    do_sample=False
)

print(tokenizer.decode(output[0], skip_special_tokens=True))
```

## 📜 라이선스

본 모델은 [EXAONE AI Model License Agreement 1.1 - NC](https://huggingface.co/LGAI-EXAONE/EXAONE-3.5-2.4B-Instruct/blob/main/LICENSE)를 따르며, **비상업적 연구 목적**으로만 사용이 가능합니다.

## 🙌 기여자
- [@lastdefiance20](https://huggingface.co/lastdefiance20)