A project for 2023-Fall SNU Creative integrated design lecture (Team L)
포커스팡은 온라인 학습과정에서 학생들의 다양한 행동 패턴을 분석하여 수업에 집중을 잘 하고 있는지 판단을 도와주고, 성적 분포를 분석하여 앞으로의 학습 계획을 도와주는 서비스이다. 이 프로젝트에서는 성적 분포를 분석하여 학생들의 전체적인 학습 수행 능력에 대한 피드백을 주는 LLM 모델을 설계하고 제작하는 것을 목표로 한다.
Before start, Need miniconda3
Create env
conda create -n env_name python=3.10.13
Install torch
conda install pytorch==1.13.1 torchvision==0.14.1 torchaudio==0.13.1 pytorch-cuda=11.7 -c pytorch -c nvidia
Install Transfomer
pip install transformers
Install flash-attention
pip install flash-attn --no-build-isolation
Install xformers
conda install xformers -c xformers
Install Colossal & Coati
cd Colossal
pip install .
cd learning
pip install -r requirements.txt
git lfs install
- polyglot-ko-1.3b
git clone https://huggingface.co/EleutherAI/polyglot-ko-1.3b
- polyglot-ko-5.8b
git clone https://huggingface.co/EleutherAI/polyglot-ko-5.8b
- polyglot-ko-12.8b
git clone https://huggingface.co/EleutherAI/polyglot-ko-12.8b
Without clone pretrained model, Parameter pretained part should be written like: EleutherAI/polyglot-ko-1.3b
This will be saved cache, so clone model and use local file is recommended.
If you want to learn with 8bit for limit of GPU memory, use this version: Quantization learning version.
You need to additional dependency for this.
pip install peft
In FOCUSPANG_LLM/Colossal/learning
, you can use train_sft.sh
script.
In FOCUSPANG_LLM/Colossal/learning
, you can use train_rm.sh
script.
In FOCUSPANG_LLM/Colossal/learning
, you can use train_prompt.sh
script.
Example command
CUDA_VISIBLE_DEVICES=1 python inference.py \
--model polyglotko \
--pretrain /mnt/hf/polyglot-ko-5.8b \
--model_path $YOUR_PPO_MODEL_PATH \
--input $YOUR_INPUT \
Information about the files/code developed ourselved can be found in the README.md provided below.