Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feat] CSV 데이터 포맷 업데이트 및 관련 코드 개선 #11

Merged
merged 6 commits into from
Nov 16, 2024

Conversation

jagaldol
Copy link
Contributor

@jagaldol jagaldol commented Nov 15, 2024

📝 Summary

CSV 데이터 포맷을 기존 JSON 형태에서 개별 컬럼으로 분리하고, 이를 사용하도록 main.py를 개선하였습니다. 또한, 관련된 환경 설정 및 코드 정리를 진행하였습니다.

✅ Checklist

  • 관련 이슈가 명시되어 있습니다.
  • 테스트가 완료되었습니다.
  • 문서 업데이트가 포함되었습니다.
  • 코드 리뷰를 위한 사전 검토를 완료했습니다.

📄 Description

  1. CSV 데이터 포맷 업데이트
  • JSON 형태의 데이터를 개별 컬럼으로 분리하여 새로운 train.csvtest.csv를 생성하고 적용하였습니다.
  1. 메인 코드 개선
  • 학습 후 체크포인트를 다시 로드하지 않도록 main.py의 로직을 변경하였습니다.
  1. 환경 변수 및 패키지 추가
  • HF_TOKEN을 추가하고 dotenv를 설치하여 환경 변수 관리 기능을 개선하였습니다.
  • 양자화를 위해 필요한 bitsandbytes 패키지를 추가하였습니다.
  1. 코드 정리
    -잘못된 주석 및 의미 없는 코드를 제거하여 가독성을 개선하였습니다.

💡 Notice (Optional)

새로운 CSV 파일 포맷에 맞게 데이터 로직이 수정되었으므로, 기존 csv를 사용하면 안되고 업데이트 된 csv 파일을 사용하셔야합니다.

이는 notion 페이지를 통해 다운받아주시길 바랍니다.

🔗 Related Issue(s)

close #10

@jagaldol jagaldol added the Type: Enhancement 기능 개선 작업 label Nov 15, 2024
@jagaldol jagaldol self-assigned this Nov 15, 2024
@@ -265,42 +246,26 @@ def compute_metrics(evaluation_result):
)
trainer.train()

# TODO 학습된 Checkpoint 경로 입력
checkpoint_path = "outputs_gemma/checkpoint-4491"
# from peft import AutoPeftModelForCausalLM
Copy link
Contributor

@canolayoo78 canolayoo78 Nov 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

import도 모델별로 구분하려고 따로 뺸 건가요??

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

추론 하기 직전 불필요하게 checkpoint 로드 하는 부분을 주석 처리하면서 AutoPeftModelForCausalLM을 사용하는 부분이 사라지게 되었습니다. 그러다보니 현재 사용되지 않는 import문이 flake8 경고로 표시되어서 함께 주석처리를 했고, 나중에 traininference를 분리(모듈화)할 때 보기 편하라고 import 주석문도 그냥 해당 위치에 뭉쳐서 주석 처리해놨습니다!

Copy link
Contributor

@gsgh3016 gsgh3016 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

수고하셨습니다 :)

main.py Show resolved Hide resolved
main.py Show resolved Hide resolved
Copy link
Contributor

@eyeol eyeol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

내용 전부 확인했습니다! 고생하셨습니다

@jagaldol jagaldol merged commit 8806149 into main Nov 16, 2024
3 checks passed
@jagaldol jagaldol deleted the feature/10-update-csv-format branch December 4, 2024 07:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Enhancement 기능 개선 작업
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEAT] traintest csv 개선
5 participants