safetensors generated_from_trainer base_model:meta-llama/Llama-2-7b-chat-hf region:us
---
base_model: meta-llama/Llama-2-7b-chat-hf
tags:
- generated_from_trainer
model-index:
- name: lora-llama-2-7b-nsmc-understanding
  results: []
---

<!-- This model card has been generated automatically according to the information the Trainer had access to. You
should probably proofread and complete it, then remove this comment. -->

# lora-llama-2-7b-nsmc-understanding

This model is a fine-tuned version of [meta-llama/Llama-2-7b-chat-hf](https://huggingface.co/meta-llama/Llama-2-7b-chat-hf) on an unknown dataset.

## Model description

More information needed

## Intended uses & limitations

More information needed

## Training and evaluation data

More information needed

## Training procedure

### Training hyperparameters

The following hyperparameters were used during training:
- learning_rate: 0.0001
- train_batch_size: 1
- eval_batch_size: 1
- seed: 42
- gradient_accumulation_steps: 2
- total_train_batch_size: 2
- optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
- lr_scheduler_type: cosine
- lr_scheduler_warmup_ratio: 0.03
- training_steps: 2000
- mixed_precision_training: Native AMP

### Training results



### Framework versions

- Transformers 4.35.2
- Pytorch 2.1.0+cu118
- Datasets 2.15.0
- Tokenizers 0.15.0




### test accuracy
llama-2
- Confusion Matrix:
||Predicted 0|Predicted 1|
|:---|---:|---:|
|Actual 0|450|42|
|Actual 1|56|452|
**Accuracy: 0.902**

kt-ai-midm
- Confusion Matrix:
||Predicted 0|Predicted 1|
|:---|---:|---:|
|Actual 0|443|49|
|Actual 1|46|462|
**Accuracy: 0.905**

### 수정부분
- 데이터로딩
  - prepare_sample_text() : 시스템 메시지 변경 및 프롬프트 포멧 설정
  - create_datasets() : train 데이터 상위 2000개 선택
- 미세튜닝용 모델 로딩
  - script_args : 사용 데이터명 nsmc 설정 및 모델명 meta-llama/Llama-2-7b-chat-hf 설정
  - max_steps : 최대 훈련 단계 2000 설정
  - save : 체크포인트 세이브를 위한 파라미터 지정
- 허깅페이스 push_to_hub 로 push
- 추론테스트
  - 프롬프트 템플릿 수정 및 시스템 메시지 변경
  - valid_dataset : test 데이터 상위 1000개 선택
- 미세튜닝된 모델 로딩 후 테스트
  - eval_dic : valid_dataset 학습한 결과 출력
- 정확도
  - valid_dataset 과 모델 훈련 결과 true_labels 를 이용한 정확도 분석
