2025-06-04 19:21:10,615 - INFO - ================================================================================ - [multilabel_classify.py:97:log_section] 2025-06-04 19:21:10,616 - INFO - = ๐Ÿ“Œ INITIALIZING TRAINING ENVIRONMENT = - [multilabel_classify.py:98:log_section] 2025-06-04 19:21:10,616 - INFO - ================================================================================ - [multilabel_classify.py:101:log_section] 2025-06-04 19:21:10,616 - INFO - ๐Ÿš€ Setting up data paths and environment variables... - [multilabel_classify.py:3313:main] 2025-06-04 19:21:10,616 - INFO - ๐Ÿ“‚ Using output directory: ../tmp/MIMIC4_DEMO/mimic4_classify_mistral7b - [multilabel_classify.py:3319:main] 2025-06-04 19:21:10,616 - INFO - ๐Ÿ› ๏ธ Command-line Arguments: - [multilabel_classify.py:343:print_args] 2025-06-04 19:21:10,616 - 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-04_19-21-10.log ๐Ÿ”น source: /home/ubuntu/.xcube/data/mimic4_demo - [multilabel_classify.py:344:print_args] 2025-06-04 19:21:10,616 - INFO - โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž– - [multilabel_classify.py:345:print_args] 2025-06-04 19:21:10,616 - INFO - ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - [multilabel_classify.py:97:log_section] 2025-06-04 19:21:10,616 - INFO - + โœจ LOADING DATASETS + - [multilabel_classify.py:98:log_section] 2025-06-04 19:21:10,616 - INFO - ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - [multilabel_classify.py:101:log_section] 2025-06-04 19:21:10,616 - INFO - ๐Ÿ“Š Loading main datasets.... - [multilabel_classify.py:3325:main] 2025-06-04 19:21:19,148 - INFO - ๐Ÿ” Total unique labels in dataset: 7942 - [multilabel_classify.py:3115:sample_df_with_full_label_coverage] 2025-06-04 19:21:19,161 - INFO - ๐Ÿงช Attempt 1: Sampled 122 rows covering 863 labels. - [multilabel_classify.py:3129:sample_df_with_full_label_coverage] 2025-06-04 19:21:19,170 - INFO - ๐Ÿงช Attempt 2: Sampled 122 rows covering 816 labels. - [multilabel_classify.py:3129:sample_df_with_full_label_coverage] 2025-06-04 19:21:19,179 - INFO - ๐Ÿงช Attempt 3: Sampled 122 rows covering 885 labels. - [multilabel_classify.py:3129:sample_df_with_full_label_coverage] 2025-06-04 19:21:19,187 - INFO - ๐Ÿงช Attempt 4: Sampled 122 rows covering 828 labels. - [multilabel_classify.py:3129:sample_df_with_full_label_coverage] 2025-06-04 19:21:19,196 - INFO - ๐Ÿงช Attempt 5: Sampled 122 rows covering 879 labels. - [multilabel_classify.py:3129:sample_df_with_full_label_coverage] 2025-06-04 19:21:19,204 - INFO - ๐Ÿงช Attempt 6: Sampled 122 rows covering 852 labels. - [multilabel_classify.py:3129:sample_df_with_full_label_coverage] 2025-06-04 19:21:19,212 - INFO - ๐Ÿงช Attempt 7: Sampled 122 rows covering 838 labels. - [multilabel_classify.py:3129:sample_df_with_full_label_coverage] 2025-06-04 19:21:19,221 - INFO - ๐Ÿงช Attempt 8: Sampled 122 rows covering 851 labels. - [multilabel_classify.py:3129:sample_df_with_full_label_coverage] 2025-06-04 19:21:19,229 - INFO - ๐Ÿงช Attempt 9: Sampled 122 rows covering 825 labels. - [multilabel_classify.py:3129:sample_df_with_full_label_coverage] 2025-06-04 19:21:19,237 - INFO - ๐Ÿงช Attempt 10: Sampled 122 rows covering 833 labels. - [multilabel_classify.py:3129:sample_df_with_full_label_coverage] 2025-06-04 19:21:19,237 - INFO - โš ๏ธ Skipping label coverage fix. 7109 labels are missing. - [multilabel_classify.py:3147:sample_df_with_full_label_coverage] 2025-06-04 19:21:19,237 - INFO - โœ… Final row count: 122 (Valid: 20, Not-valid: 102) - [multilabel_classify.py:3152:sample_df_with_full_label_coverage] 2025-06-04 19:21:19,256 - INFO - ******************************************************************************** - [multilabel_classify.py:97:log_section] 2025-06-04 19:21:19,256 - INFO - * ๐ŸŒŸ STARTING MULTI_LABEL CLASSIFICATION MODEL TRAINING * - [multilabel_classify.py:98:log_section] 2025-06-04 19:21:19,256 - INFO - ******************************************************************************** - [multilabel_classify.py:101:log_section] 2025-06-04 19:21:19,256 - INFO - ๐Ÿ” Loaded authentication token from environment - [multilabel_classify.py:3352:main] 2025-06-04 19:21:19,256 - INFO - ๐Ÿท๏ธ Hub Model ID for this Classification task: deb101/mistral-7b-instruct-v0.3-mimic4-adapt-multilabel-classify - [multilabel_classify.py:3356:main] 2025-06-04 19:21:19,256 - INFO - -------------------------------------------------------------------------------- - [multilabel_classify.py:97:log_section] 2025-06-04 19:21:19,256 - INFO - - ๐Ÿ“‹ MODEL EXISTENCE CHECK - - [multilabel_classify.py:98:log_section] 2025-06-04 19:21:19,256 - INFO - -------------------------------------------------------------------------------- - [multilabel_classify.py:101:log_section] 2025-06-04 19:21:19,257 - INFO - ๐Ÿ” Checking model existence locally and on Hugging Face Hub... - [multilabel_classify.py:3230:check_model_existence] 2025-06-04 19:21:19,257 - INFO - โŒ Model not found locally at: ../tmp/MIMIC4_DEMO/mimic4_classify_mistral7b - [multilabel_classify.py:3237:check_model_existence] 2025-06-04 19:21:19,312 - INFO - โœ… Model exists on Hugging Face Hub with ID: deb101/mistral-7b-instruct-v0.3-mimic4-adapt-multilabel-classify - [multilabel_classify.py:3249:check_model_existence] 2025-06-04 19:21:19,312 - INFO - ๐Ÿ“ Model exists either locally or on Hub - [multilabel_classify.py:3275:check_model_existence] 2025-06-04 19:21:19,312 - INFO - ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - [multilabel_classify.py:97:log_section] 2025-06-04 19:21:19,312 - INFO - + โœจ STARTING FRESH TRAINING + - [multilabel_classify.py:98:log_section] 2025-06-04 19:21:19,312 - INFO - ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - [multilabel_classify.py:101:log_section] 2025-06-04 19:21:19,312 - INFO - ๐Ÿ”„ Starting fresh training (either forced or model not found)... - [multilabel_classify.py:3369:main] 2025-06-04 19:21:19,328 - 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-04 19:21:19,329 - INFO - ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - [multilabel_classify.py:97:log_section] 2025-06-04 19:21:19,329 - INFO - + โœจ LOADING BASE MODEL + - [multilabel_classify.py:98:log_section] 2025-06-04 19:21:19,329 - INFO - ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - [multilabel_classify.py:101:log_section] 2025-06-04 19:21:19,329 - INFO - ๐Ÿ“ฅ Loading pretrained model and tokenizer... - [multilabel_classify.py:3399:main] 2025-06-04 19:21:19,329 - INFO - ๐Ÿš€ Starting model and tokenizer loading process... - [multilabel_classify.py:1216:load_base_model_and_tokenizer] 2025-06-04 19:21:19,329 - 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:1225:load_base_model_and_tokenizer] 2025-06-04 19:21:19,330 - INFO - ๐Ÿ”ค Loading tokenizer for model: deb101/mistral-7b-instruct-v0.3-mimic4-adapt... - [multilabel_classify.py:1229:load_base_model_and_tokenizer] 2025-06-04 19:21:19,597 - INFO - ๐Ÿ” Checking if deb101/mistral-7b-instruct-v0.3-mimic4-adapt is a PEFT model... - [multilabel_classify.py:1241:load_base_model_and_tokenizer] 2025-06-04 19:21:19,616 - INFO - โœ… Detected PEFT model. Base model: mistralai/Mistral-7B-Instruct-v0.3 - [multilabel_classify.py:1245:load_base_model_and_tokenizer] 2025-06-04 19:21:19,616 - INFO - ๐Ÿ” Loading model configuration for mistralai/Mistral-7B-Instruct-v0.3... - [multilabel_classify.py:1255:load_base_model_and_tokenizer] 2025-06-04 19:21:19,637 - INFO - Model type: mistral, Architectures: ['MistralForCausalLM'] - [multilabel_classify.py:1261:load_base_model_and_tokenizer] 2025-06-04 19:21:19,637 - INFO - ๐Ÿง  Loading base model: mistralai/Mistral-7B-Instruct-v0.3... - [multilabel_classify.py:1324:load_base_model_and_tokenizer] 2025-06-04 19:21:20,158 - 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-04 19:21:25,492 - INFO - ๐Ÿงฉ Loading PEFT adapters for deb101/mistral-7b-instruct-v0.3-mimic4-adapt... - [multilabel_classify.py:1339:load_base_model_and_tokenizer] 2025-06-04 19:21:25,727 - INFO - ๐Ÿ”ง Before enabling PEFT adapters for training - [multilabel_classify.py:1341:load_base_model_and_tokenizer] 2025-06-04 19:21:25,732 - INFO - ๐Ÿ”ง After Enabling PEFT adapters for training - [multilabel_classify.py:1348:load_base_model_and_tokenizer] 2025-06-04 19:21:25,735 - INFO - โœ… Model and tokenizer successfully loaded! - [multilabel_classify.py:1389:load_base_model_and_tokenizer] 2025-06-04 19:21:25,735 - INFO - ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - [multilabel_classify.py:97:log_section] 2025-06-04 19:21:25,735 - INFO - + โœจ DATA PREPROCESSING + - [multilabel_classify.py:98:log_section] 2025-06-04 19:21:25,735 - INFO - ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - [multilabel_classify.py:101:log_section] 2025-06-04 19:21:25,735 - INFO - ๐Ÿ”„ Loading and preprocessing training data... - [multilabel_classify.py:3407:main] 2025-06-04 19:21:25,739 - INFO - Total number of labels: 833 - [multilabel_classify.py:1017:preprocess_data] 2025-06-04 19:21:25,739 - INFO - Rare labels (freq < 50): 832 - [multilabel_classify.py:1018:preprocess_data] 2025-06-04 19:21:25,739 - INFO - Not rare labels (freq >= 50): 1 - [multilabel_classify.py:1019:preprocess_data] 2025-06-04 19:21:25,740 - INFO - Label partitions and classes saved to ../tmp/MIMIC4_DEMO/labels_partition.json - [multilabel_classify.py:1020:preprocess_data] 2025-06-04 19:21:27,056 - INFO - The size of training set: 567 - [multilabel_classify.py:1116:preprocess_data] 2025-06-04 19:21:27,056 - INFO - The size of Evaluation set: 136 - [multilabel_classify.py:1117:preprocess_data] 2025-06-04 19:21:27,061 - INFO - Number of unique ICD-10 codes: 833 - [multilabel_classify.py:3413:main] 2025-06-04 19:21:27,061 - INFO - ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - [multilabel_classify.py:97:log_section] 2025-06-04 19:21:27,062 - INFO - + โœจ MODEL INITIALIZATION + - [multilabel_classify.py:98:log_section] 2025-06-04 19:21:27,062 - INFO - ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - [multilabel_classify.py:101:log_section] 2025-06-04 19:21:27,062 - INFO - ๐Ÿง  Initializing custom L2R model for outputting per-token relevance scores per ICD-10 codes. - [multilabel_classify.py:3416:main] 2025-06-04 19:21:27,062 - INFO - Will now start to create Multilabel-Classification Model from the base model - [multilabel_classify.py:535:__init__] 2025-06-04 19:21:27,065 - INFO - Trainable params: 6815744 / 3765178368 (0.18%) - [multilabel_classify.py:587:compute_trainable_params] 2025-06-04 19:21:27,403 - INFO - Creating the Multi-Label Classification Model from base model mistralai/Mistral-7B-Instruct-v0.3 completed!!! - [multilabel_classify.py:577:__init__] 2025-06-04 19:21:27,407 - INFO - Trainable params: 84177025 / 3842539649 (2.19%) - [multilabel_classify.py:587:compute_trainable_params] 2025-06-04 19:21:27,407 - INFO - ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - [multilabel_classify.py:97:log_section] 2025-06-04 19:21:27,407 - INFO - + โœจ TRAINING PREPARATION + - [multilabel_classify.py:98:log_section] 2025-06-04 19:21:27,407 - INFO - ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - [multilabel_classify.py:101:log_section] 2025-06-04 19:21:27,407 - INFO - โš™๏ธ Preparing training components and optimizers... - [multilabel_classify.py:3423:main] 2025-06-04 19:21:27,464 - INFO - ๐Ÿ–ฅ๏ธ Device: NVIDIA GH200 480GB - [multilabel_classify.py:864:log_training_configuration] 2025-06-04 19:21:27,464 - INFO - ๐Ÿ”‹ CUDA Available: True - [multilabel_classify.py:867:log_training_configuration] 2025-06-04 19:21:27,464 - INFO - ๐Ÿ’พ CUDA Device Count: 1 - [multilabel_classify.py:868:log_training_configuration] 2025-06-04 19:21:27,466 - 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:856:log_training_args] 2025-06-04 19:21:27,466 - INFO - ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - [multilabel_classify.py:97:log_section] 2025-06-04 19:21:27,467 - INFO - + โœจ MODEL TRAINING + - [multilabel_classify.py:98:log_section] 2025-06-04 19:21:27,467 - INFO - ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - [multilabel_classify.py:101:log_section] 2025-06-04 19:21:27,467 - INFO - ๐Ÿ‹๏ธ Starting model training process... - [multilabel_classify.py:3445:main] 2025-06-04 19:21:27,513 - INFO - We are registering the tokenizer deb101/mistral-7b-instruct-v0.3-mimic4-adapt in Custom Trainer - [multilabel_classify.py:1961:__init__] 2025-06-04 19:21:27,765 - INFO - ๐Ÿš€ Starting Training... - [multilabel_classify.py:1615:on_train_begin] 2025-06-04 19:21:48,179 - INFO - ๐Ÿš‚ Training Metrics (Step 10) ๐Ÿš‚ +---------------+---------+ | Metric | Value | +===============+=========+ | loss | 0.6501 | +---------------+---------+ | grad_norm | 7.11264 | +---------------+---------+ | learning_rate | 2e-06 | +---------------+---------+ | epoch | 0.56338 | +---------------+---------+ - [multilabel_classify.py:1809:on_log] 2025-06-04 19:22:02,156 - INFO - Removing 'token_type_ids' from eval_dataset as they are not needed. - [multilabel_classify.py:1973:evaluate] 2025-06-04 19:22:36,988 - INFO - ๐Ÿ” Evaluation Metrics ๐Ÿ” +-------------------------------+----------+ | Metric | Value | +===============================+==========+ | eval_f1_micro | 0 | +-------------------------------+----------+ | eval_f1_macro | 0 | +-------------------------------+----------+ | eval_precision_at_5 | 0.011765 | +-------------------------------+----------+ | eval_recall_at_5 | 0.003995 | +-------------------------------+----------+ | eval_precision_at_8 | 0.020221 | +-------------------------------+----------+ | eval_recall_at_8 | 0.008339 | +-------------------------------+----------+ | eval_precision_at_15 | 0.023039 | +-------------------------------+----------+ | eval_recall_at_15 | 0.01855 | +-------------------------------+----------+ | eval_rare_f1_micro | 0 | +-------------------------------+----------+ | eval_rare_f1_macro | 0 | +-------------------------------+----------+ | eval_rare_precision | 0 | +-------------------------------+----------+ | eval_rare_recall | 0 | +-------------------------------+----------+ | eval_rare_precision_at_5 | 0.014706 | +-------------------------------+----------+ | eval_rare_recall_at_5 | 0.004619 | +-------------------------------+----------+ | eval_rare_precision_at_8 | 0.018382 | +-------------------------------+----------+ | eval_rare_recall_at_8 | 0.008006 | +-------------------------------+----------+ | eval_rare_precision_at_15 | 0.020588 | +-------------------------------+----------+ | eval_rare_recall_at_15 | 0.017777 | +-------------------------------+----------+ | 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.219905 | +-------------------------------+----------+ - [multilabel_classify.py:1828:on_evaluate] 2025-06-04 19:22:38,343 - INFO - ๐Ÿ’พ Model weights saved in safetensors format: ../tmp/MIMIC4_DEMO/mimic4_classify_mistral7b/checkpoint-18 - [multilabel_classify.py:2066:_save] 2025-06-04 19:22:38,344 - INFO - โš™๏ธ Config saved in checkpoint: ../tmp/MIMIC4_DEMO/mimic4_classify_mistral7b/checkpoint-18 - [multilabel_classify.py:2071:_save] 2025-06-04 19:22:38,346 - INFO - ๐Ÿ“‹ Saved files in ../tmp/MIMIC4_DEMO/mimic4_classify_mistral7b/checkpoint-18: +---------+-------------------+------------+ | 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:2088:_save] 2025-06-04 19:22:44,363 - INFO - ๐Ÿš‚ Training Metrics (Step 20) ๐Ÿš‚ +---------------+---------+ | Metric | Value | +===============+=========+ | loss | 0.3431 | +---------------+---------+ | grad_norm | 2.48011 | +---------------+---------+ | learning_rate | 4e-06 | +---------------+---------+ | epoch | 1.11268 | +---------------+---------+ - [multilabel_classify.py:1809:on_log] 2025-06-04 19:23:02,442 - INFO - ๐Ÿš‚ Training Metrics (Step 30) ๐Ÿš‚ +---------------+----------+ | Metric | Value | +===============+==========+ | loss | 0.124 | +---------------+----------+ | grad_norm | 0.291574 | +---------------+----------+ | learning_rate | 6e-06 | +---------------+----------+ | epoch | 1.67606 | +---------------+----------+ - [multilabel_classify.py:1809:on_log] 2025-06-04 19:23:12,766 - INFO - Removing 'token_type_ids' from eval_dataset as they are not needed. - [multilabel_classify.py:1973:evaluate] 2025-06-04 19:23:48,300 - INFO - ๐Ÿ” Evaluation Metrics ๐Ÿ” +-------------------------------+----------+ | Metric | Value | +===============================+==========+ | eval_f1_micro | 0 | +-------------------------------+----------+ | eval_f1_macro | 0 | +-------------------------------+----------+ | eval_precision_at_5 | 0.020588 | +-------------------------------+----------+ | eval_recall_at_5 | 0.006539 | +-------------------------------+----------+ | eval_precision_at_8 | 0.020221 | +-------------------------------+----------+ | eval_recall_at_8 | 0.010792 | +-------------------------------+----------+ | eval_precision_at_15 | 0.018627 | +-------------------------------+----------+ | eval_recall_at_15 | 0.018112 | +-------------------------------+----------+ | eval_rare_f1_micro | 0 | +-------------------------------+----------+ | eval_rare_f1_macro | 0 | +-------------------------------+----------+ | eval_rare_precision | 0 | +-------------------------------+----------+ | eval_rare_recall | 0 | +-------------------------------+----------+ | eval_rare_precision_at_5 | 0.016176 | +-------------------------------+----------+ | eval_rare_recall_at_5 | 0.006962 | +-------------------------------+----------+ | eval_rare_precision_at_8 | 0.020221 | +-------------------------------+----------+ | eval_rare_recall_at_8 | 0.010903 | +-------------------------------+----------+ | eval_rare_precision_at_15 | 0.021569 | +-------------------------------+----------+ | eval_rare_recall_at_15 | 0.019736 | +-------------------------------+----------+ | 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.122365 | +-------------------------------+----------+ - [multilabel_classify.py:1828:on_evaluate] 2025-06-04 19:23:49,563 - INFO - ๐Ÿ’พ Model weights saved in safetensors format: ../tmp/MIMIC4_DEMO/mimic4_classify_mistral7b/checkpoint-36 - [multilabel_classify.py:2066:_save] 2025-06-04 19:23:49,564 - INFO - โš™๏ธ Config saved in checkpoint: ../tmp/MIMIC4_DEMO/mimic4_classify_mistral7b/checkpoint-36 - [multilabel_classify.py:2071:_save] 2025-06-04 19:23:49,565 - 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:2088:_save] 2025-06-04 19:23:59,247 - INFO - ๐Ÿš‚ Training Metrics (Step 40) ๐Ÿš‚ +---------------+----------+ | Metric | Value | +===============+==========+ | loss | 0.1106 | +---------------+----------+ | grad_norm | 0.465793 | +---------------+----------+ | learning_rate | 8e-06 | +---------------+----------+ | epoch | 2.22535 | +---------------+----------+ - [multilabel_classify.py:1809:on_log] 2025-06-04 19:24:17,296 - INFO - ๐Ÿš‚ Training Metrics (Step 50) ๐Ÿš‚ +---------------+----------+ | Metric | Value | +===============+==========+ | loss | 0.1083 | +---------------+----------+ | grad_norm | 0.045582 | +---------------+----------+ | learning_rate | 1e-05 | +---------------+----------+ | epoch | 2.78873 | +---------------+----------+ - [multilabel_classify.py:1809:on_log] 2025-06-04 19:24:24,041 - INFO - Removing 'token_type_ids' from eval_dataset as they are not needed. - [multilabel_classify.py:1973:evaluate] 2025-06-04 19:24:58,992 - INFO - ๐Ÿ” Evaluation Metrics ๐Ÿ” +-------------------------------+----------+ | Metric | Value | +===============================+==========+ | eval_f1_micro | 0 | +-------------------------------+----------+ | eval_f1_macro | 0 | +-------------------------------+----------+ | eval_precision_at_5 | 0.038235 | +-------------------------------+----------+ | eval_recall_at_5 | 0.015452 | +-------------------------------+----------+ | eval_precision_at_8 | 0.036765 | +-------------------------------+----------+ | eval_recall_at_8 | 0.023271 | +-------------------------------+----------+ | eval_precision_at_15 | 0.033824 | +-------------------------------+----------+ | eval_recall_at_15 | 0.036379 | +-------------------------------+----------+ | 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.015345 | +-------------------------------+----------+ | eval_rare_precision_at_8 | 0.034007 | +-------------------------------+----------+ | eval_rare_recall_at_8 | 0.020342 | +-------------------------------+----------+ | eval_rare_precision_at_15 | 0.027941 | +-------------------------------+----------+ | eval_rare_recall_at_15 | 0.028912 | +-------------------------------+----------+ | 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.107356 | +-------------------------------+----------+ - [multilabel_classify.py:1828:on_evaluate] 2025-06-04 19:25:00,219 - INFO - ๐Ÿ’พ Model weights saved in safetensors format: ../tmp/MIMIC4_DEMO/mimic4_classify_mistral7b/checkpoint-54 - [multilabel_classify.py:2066:_save] 2025-06-04 19:25:00,220 - INFO - โš™๏ธ Config saved in checkpoint: ../tmp/MIMIC4_DEMO/mimic4_classify_mistral7b/checkpoint-54 - [multilabel_classify.py:2071:_save] 2025-06-04 19:25:00,221 - 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:2088:_save] 2025-06-04 19:25:13,465 - INFO - ๐Ÿš‚ Training Metrics (Step 60) ๐Ÿš‚ +---------------+----------+ | Metric | Value | +===============+==========+ | loss | 0.1035 | +---------------+----------+ | grad_norm | 0.185712 | +---------------+----------+ | learning_rate | 1.2e-05 | +---------------+----------+ | epoch | 3.33803 | +---------------+----------+ - [multilabel_classify.py:1809:on_log] 2025-06-04 19:25:29,148 - INFO - ๐Ÿ’พ Model weights saved in safetensors format: ../tmp/MIMIC4_DEMO/mimic4_classify_mistral7b/checkpoint-68 - [multilabel_classify.py:2066:_save] 2025-06-04 19:25:29,149 - INFO - โš™๏ธ Config saved in checkpoint: ../tmp/MIMIC4_DEMO/mimic4_classify_mistral7b/checkpoint-68 - [multilabel_classify.py:2071:_save] 2025-06-04 19:25:29,150 - 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:2088:_save] 2025-06-04 19:25:29,466 - INFO - Removing 'token_type_ids' from eval_dataset as they are not needed. - [multilabel_classify.py:1973:evaluate] 2025-06-04 19:26:04,418 - INFO - ๐Ÿ” Evaluation Metrics ๐Ÿ” +-------------------------------+----------+ | Metric | Value | +===============================+==========+ | eval_f1_micro | 0 | +-------------------------------+----------+ | eval_f1_macro | 0 | +-------------------------------+----------+ | eval_precision_at_5 | 0.132353 | +-------------------------------+----------+ | eval_recall_at_5 | 0.050205 | +-------------------------------+----------+ | eval_precision_at_8 | 0.106618 | +-------------------------------+----------+ | eval_recall_at_8 | 0.067604 | +-------------------------------+----------+ | eval_precision_at_15 | 0.078922 | +-------------------------------+----------+ | eval_recall_at_15 | 0.088833 | +-------------------------------+----------+ | eval_rare_f1_micro | 0 | +-------------------------------+----------+ | eval_rare_f1_macro | 0 | +-------------------------------+----------+ | eval_rare_precision | 0 | +-------------------------------+----------+ | eval_rare_recall | 0 | +-------------------------------+----------+ | eval_rare_precision_at_5 | 0.069118 | +-------------------------------+----------+ | eval_rare_recall_at_5 | 0.030581 | +-------------------------------+----------+ | eval_rare_precision_at_8 | 0.057904 | +-------------------------------+----------+ | eval_rare_recall_at_8 | 0.03551 | +-------------------------------+----------+ | eval_rare_precision_at_15 | 0.053922 | +-------------------------------+----------+ | eval_rare_recall_at_15 | 0.058368 | +-------------------------------+----------+ | 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.104864 | +-------------------------------+----------+ - [multilabel_classify.py:1828:on_evaluate] 2025-06-04 19:26:08,196 - INFO - ๐Ÿ’พ Model weights saved in safetensors format: ../tmp/MIMIC4_DEMO/mimic4_classify_mistral7b/checkpoint-68 - [multilabel_classify.py:2066:_save] 2025-06-04 19:26:08,198 - INFO - โš™๏ธ Config saved in checkpoint: ../tmp/MIMIC4_DEMO/mimic4_classify_mistral7b/checkpoint-68 - [multilabel_classify.py:2071:_save] 2025-06-04 19:26:08,199 - 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:2088:_save] 2025-06-04 19:26:08,600 - INFO - ๐Ÿ“‚ Loading best model from ../tmp/MIMIC4_DEMO/mimic4_classify_mistral7b/checkpoint-68 - [multilabel_classify.py:2140:_load_best_model] 2025-06-04 19:26:08,600 - INFO - ๐Ÿ–ฅ๏ธ Model is on device: cuda:0 - [multilabel_classify.py:2150:_load_best_model] 2025-06-04 19:26:08,663 - 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:2174:_load_best_model] 2025-06-04 19:26:09,667 - INFO - โœ… Loaded best model weights from ../tmp/MIMIC4_DEMO/mimic4_classify_mistral7b/checkpoint-68/model.safetensors - [multilabel_classify.py:2191:_load_best_model] 2025-06-04 19:26:09,692 - INFO - โœ”๏ธ Weight for boost_mul matches between saved and loaded state_dict - [multilabel_classify.py:2203:_load_best_model] 2025-06-04 19:26:09,714 - INFO - โœ”๏ธ Weight for boost_add matches between saved and loaded state_dict - [multilabel_classify.py:2203:_load_best_model] 2025-06-04 19:26:09,728 - INFO - ๐Ÿš‚ Training Metrics (Step 68) ๐Ÿš‚ +--------------------------+----------+ | Metric | Value | +==========================+==========+ | train_runtime | 281.964 | +--------------------------+----------+ | train_samples_per_second | 8.044 | +--------------------------+----------+ | train_steps_per_second | 0.241 | +--------------------------+----------+ | total_flos | 0 | +--------------------------+----------+ | train_loss | 0.223955 | +--------------------------+----------+ | epoch | 3.78873 | +--------------------------+----------+ - [multilabel_classify.py:1809:on_log] 2025-06-04 19:26:09,728 - INFO - โœจ Training Completed! โœจ - [multilabel_classify.py:1682:on_train_end] 2025-06-04 19:26:09,795 - INFO - ๐Ÿ“Š Training loss plot saved as '../tmp/MIMIC4_DEMO/mimic4_classify_mistral7b/train_loss_plot.png' - [multilabel_classify.py:1878:on_train_end] 2025-06-04 19:26:09,853 - INFO - ๐Ÿ“Š Evaluation loss plot saved as '../tmp/MIMIC4_DEMO/mimic4_classify_mistral7b/eval_loss_plot.png' - [multilabel_classify.py:1892:on_train_end] 2025-06-04 19:26:09,912 - INFO - ๐Ÿ“Š Evaluation metric plot saved as '../tmp/MIMIC4_DEMO/mimic4_classify_mistral7b/eval_precision_at_15_plot.png' - [multilabel_classify.py:1913:on_train_end] 2025-06-04 19:26:09,912 - INFO - ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - [multilabel_classify.py:97:log_section] 2025-06-04 19:26:09,912 - INFO - + โœจ MODEL SAVING + - [multilabel_classify.py:98:log_section] 2025-06-04 19:26:09,912 - INFO - ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - [multilabel_classify.py:101:log_section] 2025-06-04 19:26:09,912 - INFO - ๐Ÿ’พ Saving trained model and pushing to Hugging Face Hub... - [multilabel_classify.py:3459:main] 2025-06-04 19:26:09,912 - INFO - ๐Ÿ“ Creating/using output directory: ../tmp/MIMIC4_DEMO/mimic4_classify_mistral7b - [multilabel_classify.py:2666:save_and_push] 2025-06-04 19:26:11,119 - INFO - ๐Ÿ’พ Model weights saved in safetensors format: ../tmp/MIMIC4_DEMO/mimic4_classify_mistral7b - [multilabel_classify.py:2066:_save] 2025-06-04 19:26:11,121 - INFO - โš™๏ธ Config saved in checkpoint: ../tmp/MIMIC4_DEMO/mimic4_classify_mistral7b - [multilabel_classify.py:2071:_save] 2025-06-04 19:26:11,122 - 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:2088:_save] 2025-06-04 19:26:14,931 - INFO - ๐Ÿ’พ Model weights saved in safetensors format: ../tmp/MIMIC4_DEMO/mimic4_classify_mistral7b - [multilabel_classify.py:2066:_save] 2025-06-04 19:26:14,932 - INFO - โš™๏ธ Config saved in checkpoint: ../tmp/MIMIC4_DEMO/mimic4_classify_mistral7b - [multilabel_classify.py:2071:_save] 2025-06-04 19:26:14,933 - 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:2088:_save] 2025-06-04 19:27:37,188 - INFO - ๐Ÿ’พ Model saved to: ../tmp/MIMIC4_DEMO/mimic4_classify_mistral7b - [multilabel_classify.py:2670:save_and_push] 2025-06-04 19:27:37,217 - INFO - ๐Ÿ–Œ๏ธ Tokenizer saved to: ../tmp/MIMIC4_DEMO/mimic4_classify_mistral7b - [multilabel_classify.py:2674:save_and_push]