2025-06-05 14:33:04,831 - INFO - ================================================================================ - [multilabel_classify.py:100:log_section] 2025-06-05 14:33:04,831 - INFO - = ๐Ÿ“Œ INITIALIZING TRAINING ENVIRONMENT = - [multilabel_classify.py:101:log_section] 2025-06-05 14:33:04,831 - INFO - ================================================================================ - [multilabel_classify.py:104:log_section] 2025-06-05 14:33:04,831 - INFO - ๐Ÿš€ Setting up data paths and environment variables... - [multilabel_classify.py:3558:main] 2025-06-05 14:33:04,832 - INFO - ๐Ÿ“‚ Using output directory: ../tmp/MIMIC4_DEMO/mimic4_classify_mistral7b - [multilabel_classify.py:3564:main] 2025-06-05 14:33:04,832 - INFO - ๐Ÿ› ๏ธ Command-line Arguments: - [multilabel_classify.py:368:print_args] 2025-06-05 14:33:04,832 - INFO - ๐Ÿ”น output_dir: ../tmp/MIMIC4_DEMO/mimic4_classify_mistral7b ๐Ÿ”น source_url: XURLs.MIMIC4_DEMO ๐Ÿ”น data: mimic4_icd10_full ๐Ÿ”น logfile: classification_log ๐Ÿ”น base_dir: ../tmp/MIMIC4_DEMO ๐Ÿ”น hub_model_id: deb101/mistral-7b-instruct-v0.3-mimic4-adapt ๐Ÿ”น model_name: mistralai/Mistral-7B-Instruct-v0.3 ๐Ÿ”น max_length: 512 ๐Ÿ”น do_fresh_training: True ๐Ÿ”น load_from_checkpoint: False ๐Ÿ”น task: multilabel-classify ๐Ÿ”น num_train_epochs: 4 ๐Ÿ”น per_device_train_batch_size: 8 ๐Ÿ”น per_device_eval_batch_size: 8 ๐Ÿ”น metric_for_best_model: precision_at_15 ๐Ÿ”น learning_rate: 0.0001 ๐Ÿ”น final_lr_scheduling: 1e-06 ๐Ÿ”น warmup_steps: 500 ๐Ÿ”น logfile_path: ../tmp/logs/classification_log_2025-06-05_14-33-04.log ๐Ÿ”น source: /home/ubuntu/.xcube/data/mimic4_demo - [multilabel_classify.py:369:print_args] 2025-06-05 14:33:04,832 - INFO - โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž– - [multilabel_classify.py:370:print_args] 2025-06-05 14:33:04,832 - INFO - ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - [multilabel_classify.py:100:log_section] 2025-06-05 14:33:04,832 - INFO - + โœจ LOADING DATASETS + - [multilabel_classify.py:101:log_section] 2025-06-05 14:33:04,832 - INFO - ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - [multilabel_classify.py:104:log_section] 2025-06-05 14:33:04,832 - INFO - ๐Ÿ“Š Loading main datasets.... - [multilabel_classify.py:3570:main] 2025-06-05 14:33:13,354 - INFO - ๐Ÿ” Total unique labels in dataset: 7942 - [multilabel_classify.py:3351:sample_df_with_full_label_coverage] 2025-06-05 14:33:13,367 - INFO - ๐Ÿงช Attempt 1: Sampled 122 rows covering 863 labels. - [multilabel_classify.py:3365:sample_df_with_full_label_coverage] 2025-06-05 14:33:13,376 - INFO - ๐Ÿงช Attempt 2: Sampled 122 rows covering 816 labels. - [multilabel_classify.py:3365:sample_df_with_full_label_coverage] 2025-06-05 14:33:13,385 - INFO - ๐Ÿงช Attempt 3: Sampled 122 rows covering 885 labels. - [multilabel_classify.py:3365:sample_df_with_full_label_coverage] 2025-06-05 14:33:13,394 - INFO - ๐Ÿงช Attempt 4: Sampled 122 rows covering 828 labels. - [multilabel_classify.py:3365:sample_df_with_full_label_coverage] 2025-06-05 14:33:13,403 - INFO - ๐Ÿงช Attempt 5: Sampled 122 rows covering 879 labels. - [multilabel_classify.py:3365:sample_df_with_full_label_coverage] 2025-06-05 14:33:13,411 - INFO - ๐Ÿงช Attempt 6: Sampled 122 rows covering 852 labels. - [multilabel_classify.py:3365:sample_df_with_full_label_coverage] 2025-06-05 14:33:13,420 - INFO - ๐Ÿงช Attempt 7: Sampled 122 rows covering 838 labels. - [multilabel_classify.py:3365:sample_df_with_full_label_coverage] 2025-06-05 14:33:13,428 - INFO - ๐Ÿงช Attempt 8: Sampled 122 rows covering 851 labels. - [multilabel_classify.py:3365:sample_df_with_full_label_coverage] 2025-06-05 14:33:13,437 - INFO - ๐Ÿงช Attempt 9: Sampled 122 rows covering 825 labels. - [multilabel_classify.py:3365:sample_df_with_full_label_coverage] 2025-06-05 14:33:13,445 - INFO - ๐Ÿงช Attempt 10: Sampled 122 rows covering 833 labels. - [multilabel_classify.py:3365:sample_df_with_full_label_coverage] 2025-06-05 14:33:13,445 - INFO - โš ๏ธ Skipping label coverage fix. 7109 labels are missing. - [multilabel_classify.py:3383:sample_df_with_full_label_coverage] 2025-06-05 14:33:13,446 - INFO - โœ… Final row count: 122 (Valid: 20, Not-valid: 102) - [multilabel_classify.py:3388:sample_df_with_full_label_coverage] 2025-06-05 14:33:13,464 - INFO - ******************************************************************************** - [multilabel_classify.py:100:log_section] 2025-06-05 14:33:13,464 - INFO - * ๐ŸŒŸ STARTING MULTI_LABEL CLASSIFICATION MODEL TRAINING * - [multilabel_classify.py:101:log_section] 2025-06-05 14:33:13,464 - INFO - ******************************************************************************** - [multilabel_classify.py:104:log_section] 2025-06-05 14:33:13,464 - INFO - ๐Ÿ” Loaded authentication token from environment - [multilabel_classify.py:3597:main] 2025-06-05 14:33:13,465 - INFO - ๐Ÿท๏ธ Hub Model ID for this Classification task: deb101/mistral-7b-instruct-v0.3-mimic4-adapt-multilabel-classify - [multilabel_classify.py:3601:main] 2025-06-05 14:33:13,465 - INFO - -------------------------------------------------------------------------------- - [multilabel_classify.py:100:log_section] 2025-06-05 14:33:13,465 - INFO - - ๐Ÿ“‹ MODEL EXISTENCE CHECK - - [multilabel_classify.py:101:log_section] 2025-06-05 14:33:13,465 - INFO - -------------------------------------------------------------------------------- - [multilabel_classify.py:104:log_section] 2025-06-05 14:33:13,465 - INFO - ๐Ÿ” Checking model existence locally and on Hugging Face Hub... - [multilabel_classify.py:3466:check_model_existence] 2025-06-05 14:33:13,465 - INFO - โŒ Model not found locally at: ../tmp/MIMIC4_DEMO/mimic4_classify_mistral7b - [multilabel_classify.py:3473:check_model_existence] 2025-06-05 14:33:13,511 - INFO - โœ… Model exists on Hugging Face Hub with ID: deb101/mistral-7b-instruct-v0.3-mimic4-adapt-multilabel-classify - [multilabel_classify.py:3485:check_model_existence] 2025-06-05 14:33:13,512 - INFO - ๐Ÿ“ Model exists either locally or on Hub - [multilabel_classify.py:3511:check_model_existence] 2025-06-05 14:33:13,512 - INFO - ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - [multilabel_classify.py:100:log_section] 2025-06-05 14:33:13,512 - INFO - + โœจ STARTING FRESH TRAINING + - [multilabel_classify.py:101:log_section] 2025-06-05 14:33:13,512 - INFO - ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - [multilabel_classify.py:104:log_section] 2025-06-05 14:33:13,512 - INFO - ๐Ÿ”„ Starting fresh training (either forced or model not found)... - [multilabel_classify.py:3614:main] 2025-06-05 14:33:13,532 - WARNING - Note: Environment variable`HF_TOKEN` is set and is the current active token independently from the token you've just configured. - [_login.py:415:_login] 2025-06-05 14:33:13,533 - INFO - ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - [multilabel_classify.py:100:log_section] 2025-06-05 14:33:13,533 - INFO - + โœจ LOADING BASE MODEL + - [multilabel_classify.py:101:log_section] 2025-06-05 14:33:13,533 - INFO - ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - [multilabel_classify.py:104:log_section] 2025-06-05 14:33:13,533 - INFO - ๐Ÿ“ฅ Loading pretrained model and tokenizer... - [multilabel_classify.py:3644:main] 2025-06-05 14:33:13,533 - INFO - ๐Ÿš€ Starting model and tokenizer loading process... - [multilabel_classify.py:1241:load_base_model_and_tokenizer] 2025-06-05 14:33:13,534 - INFO - ๐Ÿ“Š Quantization config: BitsAndBytesConfig { "_load_in_4bit": true, "_load_in_8bit": false, "bnb_4bit_compute_dtype": "bfloat16", "bnb_4bit_quant_storage": "uint8", "bnb_4bit_quant_type": "nf4", "bnb_4bit_use_double_quant": true, "llm_int8_enable_fp32_cpu_offload": false, "llm_int8_has_fp16_weight": false, "llm_int8_skip_modules": null, "llm_int8_threshold": 6.0, "load_in_4bit": true, "load_in_8bit": false, "quant_method": "bitsandbytes" } - [multilabel_classify.py:1250:load_base_model_and_tokenizer] 2025-06-05 14:33:13,534 - INFO - ๐Ÿ”ค Loading tokenizer for model: deb101/mistral-7b-instruct-v0.3-mimic4-adapt... - [multilabel_classify.py:1254:load_base_model_and_tokenizer] 2025-06-05 14:33:13,824 - INFO - ๐Ÿ” Checking if deb101/mistral-7b-instruct-v0.3-mimic4-adapt is a PEFT model... - [multilabel_classify.py:1266:load_base_model_and_tokenizer] 2025-06-05 14:33:13,840 - INFO - โœ… Detected PEFT model. Base model: mistralai/Mistral-7B-Instruct-v0.3 - [multilabel_classify.py:1270:load_base_model_and_tokenizer] 2025-06-05 14:33:13,840 - INFO - ๐Ÿ” Loading model configuration for mistralai/Mistral-7B-Instruct-v0.3... - [multilabel_classify.py:1280:load_base_model_and_tokenizer] 2025-06-05 14:33:13,865 - INFO - Model type: mistral, Architectures: ['MistralForCausalLM'] - [multilabel_classify.py:1286:load_base_model_and_tokenizer] 2025-06-05 14:33:13,865 - INFO - ๐Ÿง  Loading base model: mistralai/Mistral-7B-Instruct-v0.3... - [multilabel_classify.py:1349:load_base_model_and_tokenizer] 2025-06-05 14:33:14,403 - INFO - We will use 90% of the memory on device 0 for storing the model, and 10% for the buffer to avoid OOM. You can set `max_memory` in to a higher value to use more memory (at your own risk). - [modeling.py:991:get_balanced_memory] 2025-06-05 14:33:19,721 - INFO - ๐Ÿงฉ Loading PEFT adapters for deb101/mistral-7b-instruct-v0.3-mimic4-adapt... - [multilabel_classify.py:1364:load_base_model_and_tokenizer] 2025-06-05 14:33:20,219 - INFO - ๐Ÿ”ง Before enabling PEFT adapters for training - [multilabel_classify.py:1366:load_base_model_and_tokenizer] 2025-06-05 14:33:20,221 - INFO - ๐Ÿ“Š trainable params: 0 || all params: 7,254,839,296 || trainable%: 0.0000 - [multilabel_classify.py:159:log_print_output] 2025-06-05 14:33:20,224 - INFO - ๐Ÿ”ง After Enabling PEFT adapters for training - [multilabel_classify.py:1373:load_base_model_and_tokenizer] 2025-06-05 14:33:20,226 - INFO - ๐Ÿ“Š trainable params: 6,815,744 || all params: 7,254,839,296 || trainable%: 0.0939 - [multilabel_classify.py:159:log_print_output] 2025-06-05 14:33:20,227 - INFO - โœ… Model and tokenizer successfully loaded! - [multilabel_classify.py:1414:load_base_model_and_tokenizer] 2025-06-05 14:33:20,227 - INFO - ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - [multilabel_classify.py:100:log_section] 2025-06-05 14:33:20,227 - INFO - + โœจ DATA PREPROCESSING + - [multilabel_classify.py:101:log_section] 2025-06-05 14:33:20,227 - INFO - ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - [multilabel_classify.py:104:log_section] 2025-06-05 14:33:20,227 - INFO - ๐Ÿ”„ Loading and preprocessing training data... - [multilabel_classify.py:3652:main] 2025-06-05 14:33:20,231 - INFO - Total number of labels: 833 - [multilabel_classify.py:1042:preprocess_data] 2025-06-05 14:33:20,231 - INFO - Rare labels (freq < 50): 832 - [multilabel_classify.py:1043:preprocess_data] 2025-06-05 14:33:20,231 - INFO - Not rare labels (freq >= 50): 1 - [multilabel_classify.py:1044:preprocess_data] 2025-06-05 14:33:20,231 - INFO - Label partitions and classes saved to ../tmp/MIMIC4_DEMO/labels_partition.json - [multilabel_classify.py:1045:preprocess_data] 2025-06-05 14:33:21,544 - INFO - The size of training set: 567 - [multilabel_classify.py:1141:preprocess_data] 2025-06-05 14:33:21,544 - INFO - The size of Evaluation set: 136 - [multilabel_classify.py:1142:preprocess_data] 2025-06-05 14:33:21,550 - INFO - Number of unique ICD-10 codes: 833 - [multilabel_classify.py:3658:main] 2025-06-05 14:33:21,550 - INFO - ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - [multilabel_classify.py:100:log_section] 2025-06-05 14:33:21,550 - INFO - + โœจ MODEL INITIALIZATION + - [multilabel_classify.py:101:log_section] 2025-06-05 14:33:21,550 - INFO - ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - [multilabel_classify.py:104:log_section] 2025-06-05 14:33:21,550 - INFO - ๐Ÿง  Initializing custom L2R model for outputting per-token relevance scores per ICD-10 codes. - [multilabel_classify.py:3661:main] 2025-06-05 14:33:21,550 - INFO - Will now start to create Multilabel-Classification Model from the base model - [multilabel_classify.py:560:__init__] 2025-06-05 14:33:21,554 - INFO - Trainable params: 6815744 / 3765178368 (0.18%) - [multilabel_classify.py:612:compute_trainable_params] 2025-06-05 14:33:21,892 - INFO - Creating the Multi-Label Classification Model from base model mistralai/Mistral-7B-Instruct-v0.3 completed!!! - [multilabel_classify.py:602:__init__] 2025-06-05 14:33:21,895 - INFO - Trainable params: 84177025 / 3842539649 (2.19%) - [multilabel_classify.py:612:compute_trainable_params] 2025-06-05 14:33:21,895 - INFO - ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - [multilabel_classify.py:100:log_section] 2025-06-05 14:33:21,895 - INFO - + โœจ TRAINING PREPARATION + - [multilabel_classify.py:101:log_section] 2025-06-05 14:33:21,895 - INFO - ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - [multilabel_classify.py:104:log_section] 2025-06-05 14:33:21,895 - INFO - โš™๏ธ Preparing training components and optimizers... - [multilabel_classify.py:3668:main] 2025-06-05 14:33:21,952 - INFO - ๐Ÿ–ฅ๏ธ Device: NVIDIA GH200 480GB - [multilabel_classify.py:889:log_training_configuration] 2025-06-05 14:33:21,952 - INFO - ๐Ÿ”‹ CUDA Available: True - [multilabel_classify.py:892:log_training_configuration] 2025-06-05 14:33:21,952 - INFO - ๐Ÿ’พ CUDA Device Count: 1 - [multilabel_classify.py:893:log_training_configuration] 2025-06-05 14:33:21,954 - INFO - ๐Ÿ“‹ Training Configuration ๐Ÿ“‹ +----------+-----------------------------+------------------------------------------------------------------+ | ๐ŸŒŸ Emoji | ๐Ÿท๏ธ Parameter | ๐Ÿ“Š Value | +----------+-----------------------------+------------------------------------------------------------------+ | ๐Ÿ“ | Output Directory | ../tmp/MIMIC4_DEMO/mimic4_classify_mistral7b | | ๐Ÿ” | Training Epochs | 4 | | ๐Ÿ‹๏ธ | Train Batch Size | 8 | | ๐Ÿ” | Eval Batch Size | 8 | | ๐Ÿ“Š | Gradient Accumulation Steps | 4 | | ๐Ÿš€ | Learning Rate | 0.0001 | | ๐ŸŒ… | Warmup Steps | 500 | | ๐Ÿ’พ | Save Strategy | epoch | | ๐Ÿ’พ | Save Total Limit | 10 | | ๐Ÿ“Š | Evaluation Strategy | epoch | | ๐ŸŽฏ | Best Model Metric | precision_at_15 | | ๐Ÿ“ | Logging Strategy | steps (every 10 steps) | | ๐ŸŒ | Push to Hub | True | | ๐ŸŒ | Hub Model ID | deb101/mistral-7b-instruct-v0.3-mimic4-adapt-multilabel-classify | | ๐Ÿ”ข | Steps per Epoch | 17 | | ๐Ÿ”ข | Total Training Steps | 68 | | ๐Ÿ”ข | Evaluation Steps | 17 | | ๐Ÿ“Š | Training Dataset Size | 567 samples ๐Ÿ‹๏ธ | | ๐Ÿ“Š | Evaluation Dataset Size | 136 samples ๐Ÿ” | +----------+-----------------------------+------------------------------------------------------------------+ - [multilabel_classify.py:881:log_training_args] 2025-06-05 14:33:21,954 - INFO - ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - [multilabel_classify.py:100:log_section] 2025-06-05 14:33:21,954 - INFO - + โœจ MODEL TRAINING + - [multilabel_classify.py:101:log_section] 2025-06-05 14:33:21,954 - INFO - ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - [multilabel_classify.py:104:log_section] 2025-06-05 14:33:21,954 - INFO - ๐Ÿ‹๏ธ Starting model training process... - [multilabel_classify.py:3690:main] 2025-06-05 14:33:21,997 - INFO - We are registering the tokenizer deb101/mistral-7b-instruct-v0.3-mimic4-adapt in Custom Trainer - [multilabel_classify.py:1986:__init__] 2025-06-05 14:33:22,241 - INFO - ๐Ÿš€ Starting Training... - [multilabel_classify.py:1640:on_train_begin] 2025-06-05 14:33:42,624 - INFO - ๐Ÿš‚ Training Metrics (Step 10) ๐Ÿš‚ +---------------+---------+ | Metric | Value | +===============+=========+ | loss | 0.5906 | +---------------+---------+ | grad_norm | 6.4284 | +---------------+---------+ | learning_rate | 2e-06 | +---------------+---------+ | epoch | 0.56338 | +---------------+---------+ - [multilabel_classify.py:1834:on_log] 2025-06-05 14:33:56,611 - INFO - Removing 'token_type_ids' from eval_dataset as they are not needed. - [multilabel_classify.py:1998:evaluate] 2025-06-05 14:34:31,640 - INFO - ๐Ÿ” Evaluation Metrics ๐Ÿ” +-------------------------------+----------+ | Metric | Value | +===============================+==========+ | eval_f1_micro | 0 | +-------------------------------+----------+ | eval_f1_macro | 0 | +-------------------------------+----------+ | eval_precision_at_5 | 0.022059 | +-------------------------------+----------+ | eval_recall_at_5 | 0.004382 | +-------------------------------+----------+ | eval_precision_at_8 | 0.023897 | +-------------------------------+----------+ | eval_recall_at_8 | 0.009611 | +-------------------------------+----------+ | eval_precision_at_15 | 0.028431 | +-------------------------------+----------+ | eval_recall_at_15 | 0.021702 | +-------------------------------+----------+ | eval_rare_f1_micro | 0 | +-------------------------------+----------+ | eval_rare_f1_macro | 0 | +-------------------------------+----------+ | eval_rare_precision | 0 | +-------------------------------+----------+ | eval_rare_recall | 0 | +-------------------------------+----------+ | eval_rare_precision_at_5 | 0.023529 | +-------------------------------+----------+ | eval_rare_recall_at_5 | 0.00463 | +-------------------------------+----------+ | eval_rare_precision_at_8 | 0.027574 | +-------------------------------+----------+ | eval_rare_recall_at_8 | 0.010825 | +-------------------------------+----------+ | eval_rare_precision_at_15 | 0.027941 | +-------------------------------+----------+ | eval_rare_recall_at_15 | 0.021662 | +-------------------------------+----------+ | eval_not_rare_f1_micro | 0.595588 | +-------------------------------+----------+ | eval_not_rare_f1_macro | 0.373272 | +-------------------------------+----------+ | eval_not_rare_precision | 0.595588 | +-------------------------------+----------+ | eval_not_rare_recall | 0.595588 | +-------------------------------+----------+ | eval_not_rare_precision_at_5 | 0.080882 | +-------------------------------+----------+ | eval_not_rare_recall_at_5 | 0.404412 | +-------------------------------+----------+ | eval_not_rare_precision_at_8 | 0.050551 | +-------------------------------+----------+ | eval_not_rare_recall_at_8 | 0.404412 | +-------------------------------+----------+ | eval_not_rare_precision_at_15 | 0.026961 | +-------------------------------+----------+ | eval_not_rare_recall_at_15 | 0.404412 | +-------------------------------+----------+ | eval_loss | 0.207322 | +-------------------------------+----------+ - [multilabel_classify.py:1853:on_evaluate] 2025-06-05 14:34:35,042 - INFO - ๐Ÿ’พ Model weights saved in safetensors format: ../tmp/MIMIC4_DEMO/mimic4_classify_mistral7b/checkpoint-18 - [multilabel_classify.py:2091:_save] 2025-06-05 14:34:35,043 - INFO - โš™๏ธ Config saved in checkpoint: ../tmp/MIMIC4_DEMO/mimic4_classify_mistral7b/checkpoint-18 - [multilabel_classify.py:2096:_save] 2025-06-05 14:34:35,045 - INFO - ๐Ÿ“‹ Saved files in ../tmp/MIMIC4_DEMO/mimic4_classify_mistral7b/checkpoint-18: +---------+--------------------+------------+ | Index | Saved File | Size | +=========+====================+============+ | 1 | training_args.bin | 0.01 MB | +---------+--------------------+------------+ | 2 | optimizer.pt | 642.30 MB | +---------+--------------------+------------+ | 3 | model.safetensors | 4267.74 MB | +---------+--------------------+------------+ | 4 | scaler.pt | 0.00 MB | +---------+--------------------+------------+ | 5 | config.json | 0.00 MB | +---------+--------------------+------------+ | 6 | scheduler.pt | 0.00 MB | +---------+--------------------+------------+ | 7 | trainer_state.json | 0.00 MB | +---------+--------------------+------------+ | 8 | rng_state.pth | 0.01 MB | +---------+--------------------+------------+ - [multilabel_classify.py:2113:_save] 2025-06-05 14:34:41,566 - INFO - ๐Ÿš‚ Training Metrics (Step 20) ๐Ÿš‚ +---------------+---------+ | Metric | Value | +===============+=========+ | loss | 0.3142 | +---------------+---------+ | grad_norm | 2.40296 | +---------------+---------+ | learning_rate | 4e-06 | +---------------+---------+ | epoch | 1.11268 | +---------------+---------+ - [multilabel_classify.py:1834:on_log] 2025-06-05 14:34:59,655 - INFO - ๐Ÿš‚ Training Metrics (Step 30) ๐Ÿš‚ +---------------+----------+ | Metric | Value | +===============+==========+ | loss | 0.1215 | +---------------+----------+ | grad_norm | 0.298427 | +---------------+----------+ | learning_rate | 6e-06 | +---------------+----------+ | epoch | 1.67606 | +---------------+----------+ - [multilabel_classify.py:1834:on_log] 2025-06-05 14:35:10,046 - INFO - Removing 'token_type_ids' from eval_dataset as they are not needed. - [multilabel_classify.py:1998:evaluate] 2025-06-05 14:35:45,066 - INFO - ๐Ÿ” Evaluation Metrics ๐Ÿ” +-------------------------------+----------+ | Metric | Value | +===============================+==========+ | eval_f1_micro | 0 | +-------------------------------+----------+ | eval_f1_macro | 0 | +-------------------------------+----------+ | eval_precision_at_5 | 0.038235 | +-------------------------------+----------+ | eval_recall_at_5 | 0.010113 | +-------------------------------+----------+ | eval_precision_at_8 | 0.035846 | +-------------------------------+----------+ | eval_recall_at_8 | 0.014265 | +-------------------------------+----------+ | eval_precision_at_15 | 0.030392 | +-------------------------------+----------+ | eval_recall_at_15 | 0.025588 | +-------------------------------+----------+ | eval_rare_f1_micro | 0 | +-------------------------------+----------+ | eval_rare_f1_macro | 0 | +-------------------------------+----------+ | eval_rare_precision | 0 | +-------------------------------+----------+ | eval_rare_recall | 0 | +-------------------------------+----------+ | eval_rare_precision_at_5 | 0.038235 | +-------------------------------+----------+ | eval_rare_recall_at_5 | 0.010045 | +-------------------------------+----------+ | eval_rare_precision_at_8 | 0.033088 | +-------------------------------+----------+ | eval_rare_recall_at_8 | 0.013213 | +-------------------------------+----------+ | eval_rare_precision_at_15 | 0.030392 | +-------------------------------+----------+ | eval_rare_recall_at_15 | 0.026888 | +-------------------------------+----------+ | eval_not_rare_f1_micro | 0.595588 | +-------------------------------+----------+ | eval_not_rare_f1_macro | 0.373272 | +-------------------------------+----------+ | eval_not_rare_precision | 0.595588 | +-------------------------------+----------+ | eval_not_rare_recall | 0.595588 | +-------------------------------+----------+ | eval_not_rare_precision_at_5 | 0.080882 | +-------------------------------+----------+ | eval_not_rare_recall_at_5 | 0.404412 | +-------------------------------+----------+ | eval_not_rare_precision_at_8 | 0.050551 | +-------------------------------+----------+ | eval_not_rare_recall_at_8 | 0.404412 | +-------------------------------+----------+ | eval_not_rare_precision_at_15 | 0.026961 | +-------------------------------+----------+ | eval_not_rare_recall_at_15 | 0.404412 | +-------------------------------+----------+ | eval_loss | 0.121781 | +-------------------------------+----------+ - [multilabel_classify.py:1853:on_evaluate] 2025-06-05 14:35:46,261 - INFO - ๐Ÿ’พ Model weights saved in safetensors format: ../tmp/MIMIC4_DEMO/mimic4_classify_mistral7b/checkpoint-36 - [multilabel_classify.py:2091:_save] 2025-06-05 14:35:46,262 - INFO - โš™๏ธ Config saved in checkpoint: ../tmp/MIMIC4_DEMO/mimic4_classify_mistral7b/checkpoint-36 - [multilabel_classify.py:2096:_save] 2025-06-05 14:35:46,263 - INFO - ๐Ÿ“‹ Saved files in ../tmp/MIMIC4_DEMO/mimic4_classify_mistral7b/checkpoint-36: +---------+-------------------+------------+ | Index | Saved File | Size | +=========+===================+============+ | 1 | training_args.bin | 0.01 MB | +---------+-------------------+------------+ | 2 | model.safetensors | 4267.74 MB | +---------+-------------------+------------+ | 3 | config.json | 0.00 MB | +---------+-------------------+------------+ - [multilabel_classify.py:2113:_save] 2025-06-05 14:35:55,917 - INFO - ๐Ÿš‚ Training Metrics (Step 40) ๐Ÿš‚ +---------------+----------+ | Metric | Value | +===============+==========+ | loss | 0.1101 | +---------------+----------+ | grad_norm | 0.456469 | +---------------+----------+ | learning_rate | 8e-06 | +---------------+----------+ | epoch | 2.22535 | +---------------+----------+ - [multilabel_classify.py:1834:on_log] 2025-06-05 14:36:14,058 - INFO - ๐Ÿš‚ Training Metrics (Step 50) ๐Ÿš‚ +---------------+----------+ | Metric | Value | +===============+==========+ | loss | 0.1081 | +---------------+----------+ | grad_norm | 0.047327 | +---------------+----------+ | learning_rate | 1e-05 | +---------------+----------+ | epoch | 2.78873 | +---------------+----------+ - [multilabel_classify.py:1834:on_log] 2025-06-05 14:36:20,858 - INFO - Removing 'token_type_ids' from eval_dataset as they are not needed. - [multilabel_classify.py:1998:evaluate] 2025-06-05 14:36:56,071 - INFO - ๐Ÿ” Evaluation Metrics ๐Ÿ” +-------------------------------+----------+ | Metric | Value | +===============================+==========+ | eval_f1_micro | 0 | +-------------------------------+----------+ | eval_f1_macro | 0 | +-------------------------------+----------+ | eval_precision_at_5 | 0.069118 | +-------------------------------+----------+ | eval_recall_at_5 | 0.022519 | +-------------------------------+----------+ | eval_precision_at_8 | 0.056066 | +-------------------------------+----------+ | eval_recall_at_8 | 0.027557 | +-------------------------------+----------+ | eval_precision_at_15 | 0.045588 | +-------------------------------+----------+ | eval_recall_at_15 | 0.039367 | +-------------------------------+----------+ | eval_rare_f1_micro | 0 | +-------------------------------+----------+ | eval_rare_f1_macro | 0 | +-------------------------------+----------+ | eval_rare_precision | 0 | +-------------------------------+----------+ | eval_rare_recall | 0 | +-------------------------------+----------+ | eval_rare_precision_at_5 | 0.070588 | +-------------------------------+----------+ | eval_rare_recall_at_5 | 0.024437 | +-------------------------------+----------+ | eval_rare_precision_at_8 | 0.056066 | +-------------------------------+----------+ | eval_rare_recall_at_8 | 0.029136 | +-------------------------------+----------+ | eval_rare_precision_at_15 | 0.041667 | +-------------------------------+----------+ | eval_rare_recall_at_15 | 0.036998 | +-------------------------------+----------+ | eval_not_rare_f1_micro | 0.595588 | +-------------------------------+----------+ | eval_not_rare_f1_macro | 0.373272 | +-------------------------------+----------+ | eval_not_rare_precision | 0.595588 | +-------------------------------+----------+ | eval_not_rare_recall | 0.595588 | +-------------------------------+----------+ | eval_not_rare_precision_at_5 | 0.080882 | +-------------------------------+----------+ | eval_not_rare_recall_at_5 | 0.404412 | +-------------------------------+----------+ | eval_not_rare_precision_at_8 | 0.050551 | +-------------------------------+----------+ | eval_not_rare_recall_at_8 | 0.404412 | +-------------------------------+----------+ | eval_not_rare_precision_at_15 | 0.026961 | +-------------------------------+----------+ | eval_not_rare_recall_at_15 | 0.404412 | +-------------------------------+----------+ | eval_loss | 0.10727 | +-------------------------------+----------+ - [multilabel_classify.py:1853:on_evaluate] 2025-06-05 14:36:57,298 - INFO - ๐Ÿ’พ Model weights saved in safetensors format: ../tmp/MIMIC4_DEMO/mimic4_classify_mistral7b/checkpoint-54 - [multilabel_classify.py:2091:_save] 2025-06-05 14:36:57,299 - INFO - โš™๏ธ Config saved in checkpoint: ../tmp/MIMIC4_DEMO/mimic4_classify_mistral7b/checkpoint-54 - [multilabel_classify.py:2096:_save] 2025-06-05 14:36:57,300 - INFO - ๐Ÿ“‹ Saved files in ../tmp/MIMIC4_DEMO/mimic4_classify_mistral7b/checkpoint-54: +---------+-------------------+------------+ | Index | Saved File | Size | +=========+===================+============+ | 1 | training_args.bin | 0.01 MB | +---------+-------------------+------------+ | 2 | model.safetensors | 4267.74 MB | +---------+-------------------+------------+ | 3 | config.json | 0.00 MB | +---------+-------------------+------------+ - [multilabel_classify.py:2113:_save] 2025-06-05 14:37:10,608 - INFO - ๐Ÿš‚ Training Metrics (Step 60) ๐Ÿš‚ +---------------+---------+ | Metric | Value | +===============+=========+ | loss | 0.1034 | +---------------+---------+ | grad_norm | 0.1776 | +---------------+---------+ | learning_rate | 1.2e-05 | +---------------+---------+ | epoch | 3.33803 | +---------------+---------+ - [multilabel_classify.py:1834:on_log] 2025-06-05 14:37:26,330 - INFO - ๐Ÿ’พ Model weights saved in safetensors format: ../tmp/MIMIC4_DEMO/mimic4_classify_mistral7b/checkpoint-68 - [multilabel_classify.py:2091:_save] 2025-06-05 14:37:26,332 - INFO - โš™๏ธ Config saved in checkpoint: ../tmp/MIMIC4_DEMO/mimic4_classify_mistral7b/checkpoint-68 - [multilabel_classify.py:2096:_save] 2025-06-05 14:37:26,333 - INFO - ๐Ÿ“‹ Saved files in ../tmp/MIMIC4_DEMO/mimic4_classify_mistral7b/checkpoint-68: +---------+-------------------+------------+ | Index | Saved File | Size | +=========+===================+============+ | 1 | training_args.bin | 0.01 MB | +---------+-------------------+------------+ | 2 | model.safetensors | 4267.74 MB | +---------+-------------------+------------+ | 3 | config.json | 0.00 MB | +---------+-------------------+------------+ - [multilabel_classify.py:2113:_save] 2025-06-05 14:37:26,638 - INFO - Removing 'token_type_ids' from eval_dataset as they are not needed. - [multilabel_classify.py:1998:evaluate] 2025-06-05 14:38:01,918 - INFO - ๐Ÿ” Evaluation Metrics ๐Ÿ” +-------------------------------+----------+ | Metric | Value | +===============================+==========+ | eval_f1_micro | 0 | +-------------------------------+----------+ | eval_f1_macro | 0 | +-------------------------------+----------+ | eval_precision_at_5 | 0.141176 | +-------------------------------+----------+ | eval_recall_at_5 | 0.049623 | +-------------------------------+----------+ | eval_precision_at_8 | 0.113051 | +-------------------------------+----------+ | eval_recall_at_8 | 0.062767 | +-------------------------------+----------+ | eval_precision_at_15 | 0.078922 | +-------------------------------+----------+ | eval_recall_at_15 | 0.084687 | +-------------------------------+----------+ | eval_rare_f1_micro | 0 | +-------------------------------+----------+ | eval_rare_f1_macro | 0 | +-------------------------------+----------+ | eval_rare_precision | 0 | +-------------------------------+----------+ | eval_rare_recall | 0 | +-------------------------------+----------+ | eval_rare_precision_at_5 | 0.083824 | +-------------------------------+----------+ | eval_rare_recall_at_5 | 0.027629 | +-------------------------------+----------+ | eval_rare_precision_at_8 | 0.067096 | +-------------------------------+----------+ | eval_rare_recall_at_8 | 0.039039 | +-------------------------------+----------+ | eval_rare_precision_at_15 | 0.054902 | +-------------------------------+----------+ | eval_rare_recall_at_15 | 0.056481 | +-------------------------------+----------+ | eval_not_rare_f1_micro | 0.595588 | +-------------------------------+----------+ | eval_not_rare_f1_macro | 0.373272 | +-------------------------------+----------+ | eval_not_rare_precision | 0.595588 | +-------------------------------+----------+ | eval_not_rare_recall | 0.595588 | +-------------------------------+----------+ | eval_not_rare_precision_at_5 | 0.080882 | +-------------------------------+----------+ | eval_not_rare_recall_at_5 | 0.404412 | +-------------------------------+----------+ | eval_not_rare_precision_at_8 | 0.050551 | +-------------------------------+----------+ | eval_not_rare_recall_at_8 | 0.404412 | +-------------------------------+----------+ | eval_not_rare_precision_at_15 | 0.026961 | +-------------------------------+----------+ | eval_not_rare_recall_at_15 | 0.404412 | +-------------------------------+----------+ | eval_loss | 0.104956 | +-------------------------------+----------+ - [multilabel_classify.py:1853:on_evaluate] 2025-06-05 14:38:05,654 - INFO - ๐Ÿ’พ Model weights saved in safetensors format: ../tmp/MIMIC4_DEMO/mimic4_classify_mistral7b/checkpoint-68 - [multilabel_classify.py:2091:_save] 2025-06-05 14:38:05,655 - INFO - โš™๏ธ Config saved in checkpoint: ../tmp/MIMIC4_DEMO/mimic4_classify_mistral7b/checkpoint-68 - [multilabel_classify.py:2096:_save] 2025-06-05 14:38:05,656 - INFO - ๐Ÿ“‹ Saved files in ../tmp/MIMIC4_DEMO/mimic4_classify_mistral7b/checkpoint-68: +---------+--------------------+------------+ | Index | Saved File | Size | +=========+====================+============+ | 1 | training_args.bin | 0.01 MB | +---------+--------------------+------------+ | 2 | optimizer.pt | 642.30 MB | +---------+--------------------+------------+ | 3 | model.safetensors | 4267.74 MB | +---------+--------------------+------------+ | 4 | scaler.pt | 0.00 MB | +---------+--------------------+------------+ | 5 | config.json | 0.00 MB | +---------+--------------------+------------+ | 6 | scheduler.pt | 0.00 MB | +---------+--------------------+------------+ | 7 | trainer_state.json | 0.01 MB | +---------+--------------------+------------+ | 8 | rng_state.pth | 0.01 MB | +---------+--------------------+------------+ - [multilabel_classify.py:2113:_save] 2025-06-05 14:38:06,173 - INFO - ๐Ÿ“‚ Loading best model from ../tmp/MIMIC4_DEMO/mimic4_classify_mistral7b/checkpoint-68 - [multilabel_classify.py:2165:_load_best_model] 2025-06-05 14:38:06,173 - INFO - ๐Ÿ–ฅ๏ธ Model is on device: cuda:0 - [multilabel_classify.py:2175:_load_best_model] 2025-06-05 14:38:06,227 - INFO - ๐Ÿ”‘ Key order comparison: +---------+--------------------------------------------+--------------------------------------------------------------------------------------+ | Index | Saved state_dict Keys | Model state_dict Keys | +=========+============================================+======================================================================================+ | 1 | attention.in_proj_bias | boost_mul | +---------+--------------------------------------------+--------------------------------------------------------------------------------------+ | 2 | attention.in_proj_weight | boost_add | +---------+--------------------------------------------+--------------------------------------------------------------------------------------+ | 3 | attention.out_proj.bias | base_model.base_model.model.model.embed_tokens.weight | +---------+--------------------------------------------+--------------------------------------------------------------------------------------+ | 4 | attention.out_proj.weight | base_model.base_model.model.model.layers.0.self_attn.q_proj.base_layer.weight | +---------+--------------------------------------------+--------------------------------------------------------------------------------------+ | 5 | base_model.base_model.model.lm_head.weight | base_model.base_model.model.model.layers.0.self_attn.q_proj.base_layer.weight.absmax | +---------+--------------------------------------------+--------------------------------------------------------------------------------------+ - [multilabel_classify.py:2199:_load_best_model] 2025-06-05 14:38:07,251 - INFO - โœ… Loaded best model weights from ../tmp/MIMIC4_DEMO/mimic4_classify_mistral7b/checkpoint-68/model.safetensors - [multilabel_classify.py:2216:_load_best_model] 2025-06-05 14:38:07,277 - INFO - โœ”๏ธ Weight for boost_mul matches between saved and loaded state_dict - [multilabel_classify.py:2228:_load_best_model] 2025-06-05 14:38:07,301 - INFO - โœ”๏ธ Weight for boost_add matches between saved and loaded state_dict - [multilabel_classify.py:2228:_load_best_model] 2025-06-05 14:38:07,316 - INFO - ๐Ÿš‚ Training Metrics (Step 68) ๐Ÿš‚ +--------------------------+----------+ | Metric | Value | +==========================+==========+ | train_runtime | 285.076 | +--------------------------+----------+ | train_samples_per_second | 7.956 | +--------------------------+----------+ | train_steps_per_second | 0.239 | +--------------------------+----------+ | total_flos | 0 | +--------------------------+----------+ | train_loss | 0.210457 | +--------------------------+----------+ | epoch | 3.78873 | +--------------------------+----------+ - [multilabel_classify.py:1834:on_log] 2025-06-05 14:38:07,317 - INFO - โœจ Training Completed! โœจ - [multilabel_classify.py:1707:on_train_end] 2025-06-05 14:38:07,385 - INFO - ๐Ÿ“Š Training loss plot saved as '../tmp/MIMIC4_DEMO/mimic4_classify_mistral7b/train_loss_plot.png' - [multilabel_classify.py:1903:on_train_end] 2025-06-05 14:38:07,444 - INFO - ๐Ÿ“Š Evaluation loss plot saved as '../tmp/MIMIC4_DEMO/mimic4_classify_mistral7b/eval_loss_plot.png' - [multilabel_classify.py:1917:on_train_end] 2025-06-05 14:38:07,502 - INFO - ๐Ÿ“Š Evaluation metric plot saved as '../tmp/MIMIC4_DEMO/mimic4_classify_mistral7b/eval_precision_at_15_plot.png' - [multilabel_classify.py:1938:on_train_end] 2025-06-05 14:38:07,503 - INFO - ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - [multilabel_classify.py:100:log_section] 2025-06-05 14:38:07,503 - INFO - + โœจ MODEL SAVING + - [multilabel_classify.py:101:log_section] 2025-06-05 14:38:07,503 - INFO - ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - [multilabel_classify.py:104:log_section] 2025-06-05 14:38:07,503 - INFO - ๐Ÿ’พ Saving trained model and pushing to Hugging Face Hub... - [multilabel_classify.py:3704:main] 2025-06-05 14:38:07,503 - INFO - ๐Ÿ“ Creating/using output directory: ../tmp/MIMIC4_DEMO/mimic4_classify_mistral7b - [multilabel_classify.py:2691:save_and_push] 2025-06-05 14:38:08,708 - INFO - ๐Ÿ’พ Model weights saved in safetensors format: ../tmp/MIMIC4_DEMO/mimic4_classify_mistral7b - [multilabel_classify.py:2091:_save] 2025-06-05 14:38:08,709 - INFO - โš™๏ธ Config saved in checkpoint: ../tmp/MIMIC4_DEMO/mimic4_classify_mistral7b - [multilabel_classify.py:2096:_save] 2025-06-05 14:38:08,710 - INFO - ๐Ÿ“‹ Saved files in ../tmp/MIMIC4_DEMO/mimic4_classify_mistral7b: +---------+-------------------------------+------------+ | Index | Saved File | Size | +=========+===============================+============+ | 1 | eval_loss_plot.png | 0.03 MB | +---------+-------------------------------+------------+ | 2 | training_args.bin | 0.01 MB | +---------+-------------------------------+------------+ | 3 | model.safetensors | 4267.74 MB | +---------+-------------------------------+------------+ | 4 | config.json | 0.00 MB | +---------+-------------------------------+------------+ | 5 | train_loss_plot.png | 0.02 MB | +---------+-------------------------------+------------+ | 6 | eval_precision_at_15_plot.png | 0.03 MB | +---------+-------------------------------+------------+ - [multilabel_classify.py:2113:_save] 2025-06-05 14:38:12,338 - INFO - ๐Ÿ’พ Model weights saved in safetensors format: ../tmp/MIMIC4_DEMO/mimic4_classify_mistral7b - [multilabel_classify.py:2091:_save] 2025-06-05 14:38:12,339 - INFO - โš™๏ธ Config saved in checkpoint: ../tmp/MIMIC4_DEMO/mimic4_classify_mistral7b - [multilabel_classify.py:2096:_save] 2025-06-05 14:38:12,340 - INFO - ๐Ÿ“‹ Saved files in ../tmp/MIMIC4_DEMO/mimic4_classify_mistral7b: +---------+-------------------------------+------------+ | Index | Saved File | Size | +=========+===============================+============+ | 1 | eval_loss_plot.png | 0.03 MB | +---------+-------------------------------+------------+ | 2 | training_args.bin | 0.01 MB | +---------+-------------------------------+------------+ | 3 | model.safetensors | 4267.74 MB | +---------+-------------------------------+------------+ | 4 | config.json | 0.00 MB | +---------+-------------------------------+------------+ | 5 | train_loss_plot.png | 0.02 MB | +---------+-------------------------------+------------+ | 6 | eval_precision_at_15_plot.png | 0.03 MB | +---------+-------------------------------+------------+ - [multilabel_classify.py:2113:_save] 2025-06-05 14:39:35,835 - INFO - ๐Ÿ’พ Model saved to: ../tmp/MIMIC4_DEMO/mimic4_classify_mistral7b - [multilabel_classify.py:2695:save_and_push] 2025-06-05 14:39:35,865 - INFO - ๐Ÿ–Œ๏ธ Tokenizer saved to: ../tmp/MIMIC4_DEMO/mimic4_classify_mistral7b - [multilabel_classify.py:2699:save_and_push]