50일차 [ huggingface trainer / SFT training/ postgresql ]
https://colab.research.google.com/drive/13zDRjyNxVdf3yCy_ER2ZudiDefYol939#scrollTo=kU3q9FO996A-
Google Colab Notebook
Run, share, and edit Python notebooks
colab.research.google.com
wandb
Weights & Biases: The AI Developer Platform
Weights & Biases is the leading AI developer platform to train and fine-tune models, manage models from experimentation to production, and track and evaluate GenAI applications powered by LLMs.
wandb.ai
training_args = TrainingArguments(
output_dir='./results',
evaluation_strategy="epoch",
num_train_epochs=3,
per_device_train_batch_size=16,
per_device_eval_batch_size=32,
learning_rate=3e-5,
logging_strategy="epoch",
load_best_model_at_end=True,
save_strategy="epoch",
report_to="wandb", # W&B 로 logging 활성화
run_name="tutorial-bert-base-uncased", # W&B 실행 이름 (선택 사항)
# metric_for_best_model의 default값 loss
metric_for_best_model="accuracy", # 위에서 정의한 compute_metrics()의 return 값을 작성
)
SFT training
- llm 학습하기 좋음
- bin 파일이 있는 모델을 써야 오류 안
https://colab.research.google.com/drive/13tfAWhg7sAvxs9SqOHwur2zewSdAfRSG#scrollTo=0SGuJwVIH7bS
Google Colab Notebook
Run, share, and edit Python notebooks
colab.research.google.com
trainer = SFTTrainer(
model,
train_dataset=dataset,
args=args, # 학습시 사용하는 HP
peft_config=peft_config,# gpu를 적게 사용하게 하는 어떤 기술
formatting_func=formatting_prompts_func, # 2개 컬럼 데이터를 하나의 데이터로 통합
data_collator=collator # answer이 후에 텍스트를 예측하도록 학습
)
postgresql
https://neon.tech/postgresql/postgresql-getting-started/load-postgresql-sample-database
Load PostgreSQL Sample Database
In this tutorial, we will show you how to load a PostgreSQL sample database into the PostgreSQL database server.
neon.tech
오늘은 디비와 연결해서 스트림릿에 화면 보여주는 것 까지 해봄
https://github.com/Jenny-Jo/llm_study_jenny/tree/feature-postgre/web
llm_study_jenny/web at feature-postgre · Jenny-Jo/llm_study_jenny
Contribute to Jenny-Jo/llm_study_jenny development by creating an account on GitHub.
github.com