YAML Metadata Warning:empty or missing yaml metadata in repo card
Check out the documentation for more information.
IMDB Trainer
Hugging Face Trainer ์ฌ์ฉ ํ๋ฆ์ ๋จ๊ณ๋ณ ์ฝ๋๋ก ๊ตฌํํ๊ณ , IMDB ํ
์คํธ ๋ถ๋ฅ ์คํ ํ์ผ์ ํจ๊ป ๋ ํด๋์
๋๋ค.
ํ์ด์ง ๊ตฌํ ์ฝ๋
page_01_basic_trainer.py: IMDB ๋ก๋, tokenizer ์ ์ฉ,TrainingArguments,Trainer,train,evaluate,predict,save_model๊ธฐ๋ณธ ํ๋ฆ์ ๋๋ค.page_02_resume_training.py:save_strategy="steps"์resume_from_checkpoint=True๋ฅผ ์ฌ์ฉํ๋ ์ฌ๊ฐ ํ์ต ํ๋ฆ์ ๋๋ค.page_03_plot_curve.py:learning_curve.jsonl์ ์ฝ์ด loss, accuracy, precision, f1 ๊ทธ๋ํ๋ฅผ ์ ์ฅํ๊ณ best checkpoint ์์น๋ฅผ ํ์ํฉ๋๋ค.page_04_stage_finetuning.py: stage1์์ backbone์ freezeํ๊ณ head๋ง ํ์ตํ ๋ค, stage2์์ best checkpoint์ ๊ฐ์ค์น๋ง ๋ก๋ํด์ ์ optimizer์ scheduler๋ก ๋ค์ ํ์ตํฉ๋๋ค.curve_logger.py: step๋ณ ๋ก๊ทธ์ ํ๊ฐ ์งํ๋ฅผ JSONL๋ก ์ ์ฅํ๋ Trainer callback์ ๋๋ค.trainer_utils.py: ๋ฐ์ดํฐ ์ ์ฒ๋ฆฌ, metric ๊ณ์ฐ, Trainer/TrainingArguments ๋ฒ์ ํธํ ์ฒ๋ฆฌ, best checkpoint ์กฐํ ํจ์์ ๋๋ค.
์ปค์คํ ๋ชจ๋ธ
custom_text_config.py: ์ปค์คํ ๋ชจ๋ธ ์ค์ ํ์ผ์ ๋๋ค.custom_text_classifier.py:PreTrainedModel๊ธฐ๋ฐ ํ ์คํธ ๋ถ๋ฅ ๋ชจ๋ธ์ ๋๋ค.
์คํ ์ค๋น
uv sync
ํ์ด์ง ์ฝ๋ ์คํ ์์
๋น ๋ฅธ ํ์ธ์ฉ์ผ๋ก ์ํ ์๋ฅผ ์ค์ฌ ์คํํ ์ ์์ต๋๋ค.
uv run python page_01_basic_trainer.py --max-train-samples 128 --max-eval-samples 64 --epochs 1
uv run python page_02_resume_training.py --max-train-samples 128 --max-eval-samples 64 --epochs 1
uv run python page_03_plot_curve.py --run-dir results/page_02_resume
uv run python page_04_stage_finetuning.py --max-train-samples 128 --max-eval-samples 64
IMDB ํ์ต ์คํ
๊ธฐ๋ณธ ๋ชจ๋ธ:
uv run python homework_0528_imdb.py --model-type auto --epochs 3
์ปค์คํ ๋ชจ๋ธ:
uv run python homework_0528_imdb.py --model-type custom --epochs 3
์ด์ด์ ํ์ต:
uv run python homework_0528_imdb.py --model-type custom --output-dir outputs/20260610_210000_custom --resume
์ฒดํฌํฌ์ธํธ๋ฅผ ์ง์ ์ง์ ํด์ ์ด์ด์ ํ์ตํ ์๋ ์์ต๋๋ค.
uv run python homework_0528_imdb.py --model-type custom --resume-checkpoint outputs/20260610_210000_custom/checkpoint-1000
์คํ ๊ฒฐ๊ณผ๋ outputs/๋ ์ง_์๊ฐ_๋ชจ๋ธ์ข
๋ฅ ํด๋์ ์ ์ฅ๋ฉ๋๋ค.
Colab Google Drive ๊ฒฝ๋ก
Drive๋ฅผ ๋ง์ดํธํ ๋ค --output-root๋ฅผ Drive ๊ฒฝ๋ก๋ก ์ง์ ํ๋ฉด ์ฒดํฌํฌ์ธํธ๋ฅผ Drive์ ์ ์ฅํ ์ ์์ต๋๋ค.
uv run python homework_0528_imdb.py --model-type custom --output-root /content/drive/MyDrive/imdb_trainer_outputs
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐ Ask for provider support