File size: 1,928 Bytes
a895723
 
eedb696
 
 
 
 
 
 
a895723
 
ed27d81
a895723
ed27d81
a895723
b6b5251
a895723
ed27d81
a895723
ed27d81
 
 
 
 
 
 
 
 
 
 
 
a895723
ed27d81
a895723
ed27d81
 
 
 
 
 
 
 
a895723
 
ed27d81
a895723
ed27d81
a895723
ed27d81
 
 
a895723
 
 
 
ed27d81
a895723
ed27d81
 
a895723
ed27d81
 
a895723
ed27d81
 
 
 
 
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
---
library_name: transformers
tags:
- nlp
- text-generation
- legal
- korean
- lbox
- LoRA
---

# Model Card for Enhanced Language Model with LoRA

## Model Description

This model, a LoRA-finetuned language model, is based on `beomi/ko-gemma-2b`. It was trained using the `lbox/lbox_open` and `ljp_criminal` datasets, specifically prepared by merging `facts` fields with `ruling.text`. This training approach aims to enhance the model's capability to understand and generate legal and factual text sequences. The fine-tuning was performed on two A100 GPUs.

## LoRA Configuration

- **LoRA Alpha**: 32
- **Rank (r)**: 16
- **LoRA Dropout**: 0.05%
- **Bias Configuration**: None
- **Targeted Modules**:
  - Query Projection (`q_proj`)
  - Key Projection (`k_proj`)
  - Value Projection (`v_proj`)
  - Output Projection (`o_proj`)
  - Gate Projection (`gate_proj`)
  - Up Projection (`up_proj`)
  - Down Projection (`down_proj`)

## Training Configuration

- **Training Epochs**: 1
- **Batch Size per Device**: 2
- **Optimizer**: Optimized AdamW with paged 32-bit precision
- **Learning Rate**: 0.00005
- **Max Gradient Norm**: 0.3
- **Learning Rate Scheduler**: Constant
- **Warm-up Steps**: 100
- **Gradient Accumulation Steps**: 1


## Model Training and Evaluation

The model was trained and evaluated using the `SFTTrainer` with the following parameters:

- **Max Sequence Length**: 4096
- **Dataset Text Field**: `training_text`
- **Packing**: Disabled


## How to Get Started with the Model

Use the following code snippet to load the model with Hugging Face Transformers:

```python
from transformers import AutoModelForCausalLM, AutoTokenizer

model = AutoModelForCausalLM.from_pretrained("your_model_id")
tokenizer = AutoTokenizer.from_pretrained("your_model_id")

# Example usage
inputs = tokenizer("Example input text", return_tensors="pt")
outputs = model.generate(**inputs)
print(tokenizer.decode(outputs[0]))
```