├── Dataset-Notebooks ├── utils │ ├── monitoring_utils.py │ ├── model_utils.py │ ├── generation_utils.py │ ├── dataset_utils.py │ └── metrics_utils.py ├── mat_pyConvert.ipynb ├── generate_samples_script.ipynb └── dataset_creation_script.ipynb ├── Model-Notebooks ├── llama3-notebooks │ ├── generate-metrics-u.sh │ ├── generate-metrics-falcon.sh │ ├── generate-metrics.sh │ ├── generate-metrics-mistral.sh │ ├── grid-reconfiguration.sh │ ├── generate-metrics.py │ ├── grid-reconfiguration.py │ └── serve_model.ipynb └── llama2-notebooks │ ├── generate-metrics.sh │ ├── grid-reconfiguration.sh │ ├── generate-metrics-u.sh │ └── grid-reconfiguration.py ├── .gitignore ├── README.md └── LICENSE /Dataset-Notebooks/utils/monitoring_utils.py: -------------------------------------------------------------------------------- 1 | import torch 2 | import subprocess as sp 3 | import os 4 | import nvidia_smi 5 | 6 | 7 | def get_memory_allocated_cached(): 8 | print(f"Memory Allocated: {torch.cuda.memory_allocated() / 1024 ** 2} MiB") 9 | print(f"Memory Cached: {torch.cuda.memory_reserved() / 1024 ** 2} MiB") 10 | 11 | def get_cuda_info(): 12 | if torch.cuda.is_available(): 13 | print('__CUDNN VERSION:', torch.backends.cudnn.version()) 14 | print('__Number CUDA Devices:', torch.cuda.device_count()) 15 | print('__CUDA Device Name:', torch.cuda.get_device_name(0)) 16 | print('__CUDA Device Total Memory [GB]:', torch.cuda.get_device_properties(0).total_memory / 1e9) 17 | else: 18 | print('CUDA is not available') 19 | 20 | def get_gpu_memory(): 21 | command = "nvidia-smi --query-gpu=memory.free --format=csv" 22 | memory_free_info = sp.check_output(command.split()).decode('ascii').split('\n')[:-1][1:] 23 | memory_free_values = [int(x.split()[0]) for i, x in enumerate(memory_free_info)] 24 | return memory_free_values 25 | 26 | def get_nvidia_smi_info(index): 27 | nvidia_smi.nvmlInit() 28 | handle = nvidia_smi.nvmlDeviceGetHandleByIndex(index) 29 | info = nvidia_smi.nvmlDeviceGetMemoryInfo(handle) 30 | 31 | print("Total memory:", info.total / 1e9, "GB") 32 | print("Free memory:", info.free / 1e9, "GB") 33 | print("Used memory:", info.used / 1e9, "GB") 34 | 35 | nvidia_smi.nvmlShutdown() -------------------------------------------------------------------------------- /Model-Notebooks/llama3-notebooks/generate-metrics-u.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | #SBATCH --output="/path/to/LLM-Reconfiguration/AutoTrain/llama2/output_file_name.out" 4 | #SBATCH --nodes=1 5 | #SBATCH --cpus-per-task=4 6 | #SBATCH --time=12:00:00 7 | #SBATCH --mem=200GB 8 | #SBATCH --gres=gpu:v100:1 9 | #SBATCH --job-name=job_name 10 | 11 | 12 | 13 | module purge 14 | module load intel/19.1.2 15 | module load anaconda3/2020.07 16 | module load python/intel/3.8.6 17 | 18 | cd /path/to/LLM-Reconfiguration/AutoTrain/Finetuned-Models/ 19 | 20 | # Print the SLURM job configurations 21 | echo "SLURM Job Configuration:" 22 | echo "Job ID: $SLURM_JOB_ID" 23 | echo "Job Name: $SLURM_JOB_NAME" 24 | echo "Node List: $SLURM_NODELIST" 25 | echo "Number of Nodes: $SLURM_JOB_NUM_NODES" 26 | echo "Number of Tasks: $SLURM_NTASKS" 27 | echo "CPUs per Task: $SLURM_CPUS_PER_TASK" 28 | echo "Memory per Node: $SLURM_MEM_PER_NODE" 29 | echo "Time Limit: $SLURM_TIMELIMIT" 30 | echo "Partition: $SLURM_JOB_PARTITION" 31 | echo "Output File: $SLURM_JOB_OUT" 32 | 33 | echo "Hardware Configuration" 34 | echo "Processor: $(lscpu | grep 'Model name' | awk -F ':' '{print $2}' | xargs)" 35 | echo "RAM: $(free -h | grep Mem: | awk '{print $4}')" 36 | echo "GPU: $(nvidia-smi -q | grep 'Product Name')" 37 | 38 | singularity exec --nv --overlay /path/to/pytorch-example/my_pytorch.ext3:ro /scratch/work/public/singularity/cuda12.3.2-cudnn9.0.0-ubuntu-22.04.4.sif /bin/bash -c \ 39 | "source /ext3/env.sh; python /path/to/LLM-Reconfiguration/Model-Notebooks/llama3-notebooks/generate-metrics.py \ 40 | --data_path /path/to/LLM-Reconfiguration/Dataset-Notebooks/train_files/train_33_69_84_nodes.csv \ 41 | --model_id meta-llama/Llama-2-7b-hf \ 42 | --model_for_generation_path meta-llama/Llama-2-7b-hf \ 43 | --max_new_tokens 1200 \ 44 | --filename_txt /path/to/LLM-Reconfiguration/Dataset-Notebooks/evaluations/metrics/metrics_file_name.txt\ 45 | --filename_csv /scratch/pc2442/LLM-Reconfiguration/Dataset-Notebooks/evaluations/responses/responses_file_name.csv\ 46 | --num_samples 500 \ 47 | --untrained True" 48 | -------------------------------------------------------------------------------- /Model-Notebooks/llama3-notebooks/generate-metrics-falcon.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | #SBATCH --output="/path/to/LLM-Reconfiguration/AutoTrain/llama3/output_file_name.out" 4 | #SBATCH --nodes=1 5 | #SBATCH --cpus-per-task=4 6 | #SBATCH --time=12:00:00 7 | #SBATCH --mem=200GB 8 | #SBATCH --gres=gpu:v100:1 9 | #SBATCH --job-name=job_name 10 | #SBATCH --account=account_name 11 | 12 | 13 | module purge 14 | module load intel/19.1.2 15 | module load anaconda3/2020.07 16 | module load python/intel/3.8.6 17 | 18 | cd /path/to/LLM-Reconfiguration/AutoTrain/Finetuned-Models/ 19 | 20 | # Print the SLURM job configurations 21 | echo "SLURM Job Configuration:" 22 | echo "Job ID: $SLURM_JOB_ID" 23 | echo "Job Name: $SLURM_JOB_NAME" 24 | echo "Node List: $SLURM_NODELIST" 25 | echo "Number of Nodes: $SLURM_JOB_NUM_NODES" 26 | echo "Number of Tasks: $SLURM_NTASKS" 27 | echo "CPUs per Task: $SLURM_CPUS_PER_TASK" 28 | echo "Memory per Node: $SLURM_MEM_PER_NODE" 29 | echo "Time Limit: $SLURM_TIMELIMIT" 30 | echo "Partition: $SLURM_JOB_PARTITION" 31 | echo "Output File: $SLURM_JOB_OUT" 32 | 33 | echo "Hardware Configuration" 34 | echo "Processor: $(lscpu | grep 'Model name' | awk -F ':' '{print $2}' | xargs)" 35 | echo "RAM: $(free -h | grep Mem: | awk '{print $4}')" 36 | echo "GPU: $(nvidia-smi -q | grep 'Product Name')" 37 | 38 | singularity exec --nv --overlay /path/to/pytorch-example/my_pytorch.ext3:ro /scratch/work/public/singularity/cuda12.3.2-cudnn9.0.0-ubuntu-22.04.4.sif /bin/bash -c \ 39 | "source /ext3/env.sh; python /path/toLLM-Reconfiguration/Model-Notebooks/llama3-notebooks/generate-metrics.py \ 40 | --data_path /path/to/LLM-Reconfiguration/Dataset-Notebooks/train_files/train_33_69_84_nodes.csv \ 41 | --model_id tiiuae/falcon-7b-instruct \ 42 | --model_for_generation_path tiiuae/falcon-7b-instruct \ 43 | --max_new_tokens 1200 \ 44 | --filename_txt /path/to/LLM-Reconfiguration/Dataset-Notebooks/evaluations/metrics/metrics_file_name.txt\ 45 | --filename_csv /path/to/LLM-Reconfiguration/Dataset-Notebooks/evaluations/responses/responses_file_name.csv\ 46 | --num_samples 500 \ 47 | --untrained True" 48 | -------------------------------------------------------------------------------- /Model-Notebooks/llama2-notebooks/generate-metrics.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | #SBATCH --output="/path/to/LLM-Reconfiguration/AutoTrain/llama2/out_file_name.out" 4 | #SBATCH --nodes=1 5 | #SBATCH --cpus-per-task=4 6 | #SBATCH --time=12:00:00 7 | #SBATCH --mem=200GB 8 | #SBATCH --gres=gpu:v100:1 9 | #SBATCH --job-name=job_name 10 | 11 | 12 | 13 | module purge 14 | module load intel/19.1.2 15 | module load anaconda3/2020.07 16 | module load python/intel/3.8.6 17 | 18 | cd /path/to/LLM-Reconfiguration/AutoTrain/Finetuned-Models/ 19 | 20 | # Print the SLURM job configurations 21 | echo "SLURM Job Configuration:" 22 | echo "Job ID: $SLURM_JOB_ID" 23 | echo "Job Name: $SLURM_JOB_NAME" 24 | echo "Node List: $SLURM_NODELIST" 25 | echo "Number of Nodes: $SLURM_JOB_NUM_NODES" 26 | echo "Number of Tasks: $SLURM_NTASKS" 27 | echo "CPUs per Task: $SLURM_CPUS_PER_TASK" 28 | echo "Memory per Node: $SLURM_MEM_PER_NODE" 29 | echo "Time Limit: $SLURM_TIMELIMIT" 30 | echo "Partition: $SLURM_JOB_PARTITION" 31 | echo "Output File: $SLURM_JOB_OUT" 32 | 33 | echo "Hardware Configuration" 34 | echo "Processor: $(lscpu | grep 'Model name' | awk -F ':' '{print $2}' | xargs)" 35 | echo "RAM: $(free -h | grep Mem: | awk '{print $4}')" 36 | echo "GPU: $(nvidia-smi -q | grep 'Product Name')" 37 | 38 | singularity exec --nv --overlay /path/to/pytorch-example/my_pytorch.ext3:ro /scratch/work/public/singularity/cuda12.3.2-cudnn9.0.0-ubuntu-22.04.4.sif /bin/bash -c \ 39 | "source /ext3/env.sh; python /path/to/LLM-Reconfiguration/Model-Notebooks/llama3-notebooks/generate-metrics.py \ 40 | --data_path /path/to/LLM-Reconfiguration/Dataset-Notebooks/train_files/train_33_69_84_nodes.csv \ 41 | --model_id /path/to/LLM-Reconfiguration/AutoTrain/llama2/model_name/checkpoint-21900 \ 42 | --model_for_generation_path /path/to/LLM-Reconfiguration/AutoTrain/llama2/model_name/checkpoint-21900 \ 43 | --max_new_tokens 1200 \ 44 | --filename_txt /path/to/LLM-Reconfiguration/Dataset-Notebooks/evaluations/metrics/metrics_file_name.txt\ 45 | --filename_csv /scratch/pc2442/LLM-Reconfiguration/Dataset-Notebooks/evaluations/responses/responses_file_name.csv\ 46 | --num_samples 500 " 47 | -------------------------------------------------------------------------------- /Model-Notebooks/llama3-notebooks/generate-metrics.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | #SBATCH --output="/path/to/LLM-Reconfiguration/AutoTrain/llama3/model_name.out" 4 | #SBATCH --nodes=1 5 | #SBATCH --cpus-per-task=4 6 | #SBATCH --time=20:00:00 7 | #SBATCH --mem=200GB 8 | #SBATCH --gres=gpu:1 9 | #SBATCH --constraint=v100|rtx8000|a100 10 | #SBATCH --job-name=job_name 11 | #SBATCH --mail-type=BEGIN,END 12 | #SBATCH --mail-user=user_email 13 | 14 | 15 | 16 | module purge 17 | module load intel/19.1.2 18 | module load anaconda3/2020.07 19 | module load python/intel/3.8.6 20 | 21 | 22 | # Print the SLURM job configurations 23 | echo "SLURM Job Configuration:" 24 | echo "Job ID: $SLURM_JOB_ID" 25 | echo "Job Name: $SLURM_JOB_NAME" 26 | echo "Node List: $SLURM_NODELIST" 27 | echo "Number of Nodes: $SLURM_JOB_NUM_NODES" 28 | echo "Number of Tasks: $SLURM_NTASKS" 29 | echo "CPUs per Task: $SLURM_CPUS_PER_TASK" 30 | echo "Memory per Node: $SLURM_MEM_PER_NODE" 31 | echo "Time Limit: $SLURM_TIMELIMIT" 32 | echo "Partition: $SLURM_JOB_PARTITION" 33 | echo "Output File: $SLURM_JOB_OUT" 34 | 35 | echo "Hardware Configuration" 36 | echo "Processor: $(lscpu | grep 'Model name' | awk -F ':' '{print $2}' | xargs)" 37 | echo "RAM: $(free -h | grep Mem: | awk '{print $4}')" 38 | echo "GPU: $(nvidia-smi -q | grep 'Product Name')" 39 | 40 | singularity exec --nv --overlay /path/to/pytorch-example/my_pytorch.ext3:ro /scratch/work/public/singularity/cuda12.3.2-cudnn9.0.0-ubuntu-22.04.4.sif /bin/bash -c \ 41 | "source /ext3/env.sh; python /path/to/LLM-Reconfiguration/Model-Notebooks/llama3-notebooks/generate-metrics.py \ 42 | --data_path /path/to/LLM-Reconfiguration/Dataset-Notebooks/train_files/train_33_69_84_nodes.csv \ 43 | --model_id /path/to/LLM-Reconfiguration/AutoTrain/llama3/model_name/checkpoint-26280 \ 44 | --model_for_generation_path /path/to/LLM-Reconfiguration/AutoTrain/llama3/model_name/checkpoint-26280 \ 45 | --max_new_tokens 1400 \ 46 | --filename_txt /path/to/LLM-Reconfiguration/Dataset-Notebooks/evaluations/metrics/metrics_file_name.txt\ 47 | --filename_csv /path/to/LLM-Reconfiguration/Dataset-Notebooks/evaluations/responses/responses_file_name.csv\ 48 | --num_samples 500 " 49 | -------------------------------------------------------------------------------- /Model-Notebooks/llama3-notebooks/generate-metrics-mistral.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | #SBATCH --output="/path/to/LLM-Reconfiguration/AutoTrain/llama3/output_file_name.out" 4 | #SBATCH --nodes=1 5 | #SBATCH --cpus-per-task=4 6 | #SBATCH --time=12:00:00 7 | #SBATCH --mem=200GB 8 | #SBATCH --gres=gpu:v100:1 9 | #SBATCH --job-name=job_name 10 | #SBATCH --account=account_name 11 | #SBATCH --mail-type=END 12 | #SBATCH --mail-user=user_email 13 | 14 | module purge 15 | module load intel/19.1.2 16 | module load anaconda3/2020.07 17 | module load python/intel/3.8.6 18 | 19 | cd /path/to/LLM-Reconfiguration/AutoTrain/Finetuned-Models/ 20 | 21 | # Print the SLURM job configurations 22 | echo "SLURM Job Configuration:" 23 | echo "Job ID: $SLURM_JOB_ID" 24 | echo "Job Name: $SLURM_JOB_NAME" 25 | echo "Node List: $SLURM_NODELIST" 26 | echo "Number of Nodes: $SLURM_JOB_NUM_NODES" 27 | echo "Number of Tasks: $SLURM_NTASKS" 28 | echo "CPUs per Task: $SLURM_CPUS_PER_TASK" 29 | echo "Memory per Node: $SLURM_MEM_PER_NODE" 30 | echo "Time Limit: $SLURM_TIMELIMIT" 31 | echo "Partition: $SLURM_JOB_PARTITION" 32 | echo "Output File: $SLURM_JOB_OUT" 33 | 34 | echo "Hardware Configuration" 35 | echo "Processor: $(lscpu | grep 'Model name' | awk -F ':' '{print $2}' | xargs)" 36 | echo "RAM: $(free -h | grep Mem: | awk '{print $4}')" 37 | echo "GPU: $(nvidia-smi -q | grep 'Product Name')" 38 | 39 | singularity exec --nv --overlay /path/to/pytorch-example/my_pytorch.ext3:ro /scratch/work/public/singularity/cuda12.3.2-cudnn9.0.0-ubuntu-22.04.4.sif /bin/bash -c \ 40 | "source /ext3/env.sh; python /path/to/LLM-Reconfiguration/Model-Notebooks/llama3-notebooks/generate-metrics.py \ 41 | --data_path /path/to/LLM-Reconfiguration/Dataset-Notebooks/train_files/train_33_69_84_nodes.csv \ 42 | --model_id mistralai/Mistral-7B-Instruct-v0.3 \ 43 | --model_for_generation_path mistralai/Mistral-7B-Instruct-v0.3 \ 44 | --max_new_tokens 1200 \ 45 | --filename_txt /path/to/LLM-Reconfiguration/Dataset-Notebooks/evaluations/metrics/metrics_file_name.txt\ 46 | --filename_csv /scratch/pc2442/LLM-Reconfiguration/Dataset-Notebooks/evaluations/responses/responses_file_name.csv\ 47 | --num_samples 500 \ 48 | --untrained True" 49 | -------------------------------------------------------------------------------- /Model-Notebooks/llama2-notebooks/grid-reconfiguration.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | #SBATCH --output="/path/to/LLM-Reconfiguration/AutoTrain/llama2/out_file_name.out" 4 | #SBATCH --nodes=1 5 | #SBATCH --cpus-per-task=4 6 | #SBATCH --time=95:00:00 7 | #SBATCH --mem=200GB 8 | #SBATCH --gres=gpu:a100:1 9 | #SBATCH --job-name=job_name 10 | #SBATCH --account=account_name 11 | 12 | 13 | module purge 14 | module load intel/19.1.2 15 | module load anaconda3/2020.07 16 | module load python/intel/3.8.6 17 | 18 | 19 | # Print the SLURM job configurations 20 | echo "SLURM Job Configuration:" 21 | echo "Job ID: $SLURM_JOB_ID" 22 | echo "Job Name: $SLURM_JOB_NAME" 23 | echo "Node List: $SLURM_NODELIST" 24 | echo "Number of Nodes: $SLURM_JOB_NUM_NODES" 25 | echo "Number of Tasks: $SLURM_NTASKS" 26 | echo "CPUs per Task: $SLURM_CPUS_PER_TASK" 27 | echo "Memory per Node: $SLURM_MEM_PER_NODE" 28 | echo "Time Limit: $SLURM_TIMELIMIT" 29 | echo "Partition: $SLURM_JOB_PARTITION" 30 | echo "Output File: $SLURM_JOB_OUT" 31 | 32 | echo "Hardware Configuration" 33 | echo "Processor: $(lscpu | grep 'Model name' | awk -F ':' '{print $2}' | xargs)" 34 | echo "RAM: $(free -h | grep Mem: | awk '{print $4}')" 35 | echo "GPU: $(nvidia-smi -q | grep 'Product Name')" 36 | 37 | singularity exec --nv --overlay /path/to/pytorch-example/my_pytorch.ext3:ro /scratch/work/public/singularity/cuda12.3.2-cudnn9.0.0-ubuntu-22.04.4.sif /bin/bash -c \ 38 | "source activate /vast/user_name/penv_v2; source /ext3/env.sh; python /path/to/LLM-Reconfiguration/Model-Notebooks/llama2-notebooks/grid-reconfiguration.py \ 39 | --data_path /path/to/LLM-Reconfiguration/Dataset-Notebooks/train_files/train_33_69_84_nodes.csv \ 40 | --model_id meta-llama/Llama-2-7b-hf \ 41 | --output_model /path/to/LLM-Reconfiguration/AutoTrain/llama2/model_name \ 42 | --num_train_epochs 10 \ 43 | --batch_size 4 \ 44 | --model_name_hf hf_model_name \ 45 | --tokenizer_name_hf hf_tokenizer_name \ 46 | --custom_loss 0 \ 47 | --custom_loss_config IEL,SUL,CYL \ 48 | --cycles_loss_scaling_factor 1 \ 49 | --model_for_generation_path /path/to/LLM-Reconfiguration/AutoTrain/llama2/model_name/checkpoint-14600/ \ 50 | --max_new_tokens 1200 " 51 | -------------------------------------------------------------------------------- /Model-Notebooks/llama2-notebooks/generate-metrics-u.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | #SBATCH --output="/scratch/pc2442/LLM-Reconfiguration/AutoTrain/llama2/llama2-finetuning-untrained-GET-METRICS-84N.out" 4 | #SBATCH --nodes=1 5 | #SBATCH --cpus-per-task=4 6 | #SBATCH --time=12:00:00 7 | #SBATCH --mem=200GB 8 | #SBATCH --gres=gpu:v100:1 9 | #SBATCH --job-name=llama2-finetuning-untrained-GET-METRICS-84N 10 | 11 | 12 | 13 | module purge 14 | module load intel/19.1.2 15 | module load anaconda3/2020.07 16 | module load python/intel/3.8.6 17 | 18 | cd /scratch/pc2442/LLM-Reconfiguration/AutoTrain/Finetuned-Models/ 19 | 20 | # Print the SLURM job configurations 21 | echo "SLURM Job Configuration:" 22 | echo "Job ID: $SLURM_JOB_ID" 23 | echo "Job Name: $SLURM_JOB_NAME" 24 | echo "Node List: $SLURM_NODELIST" 25 | echo "Number of Nodes: $SLURM_JOB_NUM_NODES" 26 | echo "Number of Tasks: $SLURM_NTASKS" 27 | echo "CPUs per Task: $SLURM_CPUS_PER_TASK" 28 | echo "Memory per Node: $SLURM_MEM_PER_NODE" 29 | echo "Time Limit: $SLURM_TIMELIMIT" 30 | echo "Partition: $SLURM_JOB_PARTITION" 31 | echo "Output File: $SLURM_JOB_OUT" 32 | 33 | echo "Hardware Configuration" 34 | echo "Processor: $(lscpu | grep 'Model name' | awk -F ':' '{print $2}' | xargs)" 35 | echo "RAM: $(free -h | grep Mem: | awk '{print $4}')" 36 | echo "GPU: $(nvidia-smi -q | grep 'Product Name')" 37 | 38 | singularity exec --nv --overlay /scratch/pc2442/pytorch-example/my_pytorch.ext3:ro /scratch/work/public/singularity/cuda12.3.2-cudnn9.0.0-ubuntu-22.04.4.sif /bin/bash -c \ 39 | "source /ext3/env.sh; python /scratch/pc2442/LLM-Reconfiguration/Model-Notebooks/llama3-notebooks/generate-metrics.py \ 40 | --data_path /scratch/pc2442/LLM-Reconfiguration/Dataset-Notebooks/train_files/train_84_nodes.csv \ 41 | --model_id meta-llama/Llama-2-7b-hf \ 42 | --model_for_generation_path meta-llama/Llama-2-7b-hf \ 43 | --max_new_tokens 1200 \ 44 | --filename_txt /scratch/pc2442/LLM-Reconfiguration/Dataset-Notebooks/evaluations/metrics/llama2-grid-reconfiguration-untrained-testset-metrics-n500-84N.txt\ 45 | --filename_csv /scratch/pc2442/LLM-Reconfiguration/Dataset-Notebooks/evaluations/responses/llama2-grid-reconfiguration-untrained-testset-metrics-n500-84N.csv\ 46 | --num_samples 500 " -------------------------------------------------------------------------------- /Model-Notebooks/llama3-notebooks/grid-reconfiguration.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | #SBATCH --output="path/to/LLM-Reconfiguration/AutoTrain/llama3/output_file_name.out" 4 | #SBATCH --nodes=1 5 | #SBATCH --cpus-per-task=4 6 | #SBATCH --time=0:10:00 7 | #SBATCH --mem=200GB 8 | #SBATCH --gres=gpu:v100:1 9 | #SBATCH --job-name=job_name 10 | #SBATCH --account=account_name 11 | 12 | 13 | module purge 14 | module load intel/19.1.2 15 | module load anaconda3/2020.07 16 | module load python/intel/3.8.6 17 | 18 | 19 | # Print the SLURM job configurations 20 | echo "SLURM Job Configuration:" 21 | echo "Job ID: $SLURM_JOB_ID" 22 | echo "Job Name: $SLURM_JOB_NAME" 23 | echo "Node List: $SLURM_NODELIST" 24 | echo "Number of Nodes: $SLURM_JOB_NUM_NODES" 25 | echo "Number of Tasks: $SLURM_NTASKS" 26 | echo "CPUs per Task: $SLURM_CPUS_PER_TASK" 27 | echo "Memory per Node: $SLURM_MEM_PER_NODE" 28 | echo "Time Limit: $SLURM_TIMELIMIT" 29 | echo "Partition: $SLURM_JOB_PARTITION" 30 | echo "Output File: $SLURM_JOB_OUT" 31 | 32 | echo "Hardware Configuration" 33 | echo "Processor: $(lscpu | grep 'Model name' | awk -F ':' '{print $2}' | xargs)" 34 | echo "RAM: $(free -h | grep Mem: | awk '{print $4}')" 35 | echo "GPU: $(nvidia-smi -q | grep 'Product Name')" 36 | 37 | 38 | singularity exec --nv --overlay /path/to/pytorch-example/my_pytorch.ext3:ro /scratch/work/public/singularity/cuda12.3.2-cudnn9.0.0-ubuntu-22.04.4.sif /bin/bash -c \ 39 | "source activate /path/to/penv_v2; source /ext3/env.sh; python /path/to/LLM-Reconfiguration/Model-Notebooks/llama3-notebooks/grid-reconfiguration.py \ 40 | --data_path /path/to/LLM-Reconfiguration/Dataset-Notebooks/train_files/train_33_69_84_nodes.csv \ 41 | --model_id meta-llama/Llama-3.1-8B-Instruct \ 42 | --output_model /path/to/LLM-Reconfiguration/AutoTrain/llama3/llama3-grid-reconfiguration-10epoch-33N-69N-84N \ 43 | --num_train_epochs 10 \ 44 | --batch_size 4 \ 45 | --model_name_hf model_name 46 | --tokenizer_name_hf tokenizer_name 47 | --custom_loss 0 \ 48 | --custom_loss_config IEL,SUL,CYL \ 49 | --cycles_loss_scaling_factor 1 \ 50 | --model_for_generation_path /path/to/LLM-Reconfiguration/AutoTrain/llama3/model_name/checkpoint-14600/ \ 51 | --max_new_tokens 1200 " 52 | -------------------------------------------------------------------------------- /Model-Notebooks/llama3-notebooks/generate-metrics.py: -------------------------------------------------------------------------------- 1 | import torch 2 | from datasets import load_dataset, Dataset 3 | from peft import LoraConfig, AutoPeftModelForCausalLM 4 | from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig, TrainingArguments 5 | from trl import SFTTrainer 6 | import os 7 | import re 8 | import sys 9 | import argparse 10 | 11 | sys.path.append(os.path.abspath('/path/to/LLM-Reconfiguration/Dataset-Notebooks/utils')) 12 | 13 | from dataset_utils import * 14 | from model_utils import * 15 | from generation_utils import * 16 | from metrics_utils import * 17 | 18 | def parse_args(): 19 | parser = argparse.ArgumentParser(description="Train a language model with specific configurations.") 20 | parser.add_argument('--data_path', type=str, required=True, help='Path to the dataset.') 21 | parser.add_argument('--model_id', type=str, required=True, help='Model ID to use.') 22 | parser.add_argument('--max_new_tokens', type=int, required=True, help='Maximum number of new tokens generated.') 23 | parser.add_argument('--model_for_generation_path', type=str, required=True, help='Model path to use for generation.') 24 | parser.add_argument('--filename_txt', type=str, required=True, help='File path and name to save the metrics as txt.') 25 | parser.add_argument('--filename_csv', type=str, required=True, help='File path and name to save the metrics as csv.') 26 | parser.add_argument('--num_samples', type=int, required=True, help='Number of samples generated.') 27 | parser.add_argument('--untrained', type=str, default='False', help='Is the model untrained.') 28 | return parser.parse_args() 29 | 30 | def main(): 31 | 32 | args = parse_args() 33 | 34 | print('Training configurations: \n', args) 35 | 36 | data_path = args.data_path 37 | model_id = args.model_id 38 | untrained = args.untrained 39 | 40 | train_dataset, validation_dataset, test_dataset = prepare_train_data(data_path) 41 | 42 | model = get_model(model_id) 43 | tokenizer = get_tokenizer(model_id) 44 | 45 | if untrained == 'False': 46 | peft_config = LoraConfig( 47 | r=8, lora_alpha=16, lora_dropout=0.05, bias="none", task_type="CAUSAL_LM" 48 | ) 49 | 50 | model_path = args.model_for_generation_path 51 | 52 | model = peft_merge_unload(model_id, model_path) 53 | 54 | from functools import partial 55 | 56 | # Create a partial function with fixed model and tokenizer 57 | partial_generate_response = partial(generate_response, model=model, tokenizer=tokenizer, max_new_tokens=args.max_new_tokens) 58 | 59 | generate_metrics(test_dataset, partial_generate_response, num_samples=args.num_samples, filename_txt=args.filename_txt, filename_csv = args.filename_csv) 60 | 61 | 62 | if __name__ == "__main__": 63 | main() 64 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | 6 | # C extensions 7 | *.so 8 | 9 | # Distribution / packaging 10 | .Python 11 | build/ 12 | develop-eggs/ 13 | dist/ 14 | downloads/ 15 | eggs/ 16 | .eggs/ 17 | lib/ 18 | lib64/ 19 | parts/ 20 | sdist/ 21 | var/ 22 | wheels/ 23 | share/python-wheels/ 24 | *.egg-info/ 25 | .installed.cfg 26 | *.egg 27 | MANIFEST 28 | 29 | # PyInstaller 30 | # Usually these files are written by a python script from a template 31 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 32 | *.manifest 33 | *.spec 34 | 35 | # Installer logs 36 | pip-log.txt 37 | pip-delete-this-directory.txt 38 | 39 | # Unit test / coverage reports 40 | htmlcov/ 41 | .tox/ 42 | .nox/ 43 | .coverage 44 | .coverage.* 45 | .cache 46 | nosetests.xml 47 | coverage.xml 48 | *.cover 49 | *.py,cover 50 | .hypothesis/ 51 | .pytest_cache/ 52 | cover/ 53 | 54 | # Translations 55 | *.mo 56 | *.pot 57 | 58 | # Django stuff: 59 | *.log 60 | local_settings.py 61 | db.sqlite3 62 | db.sqlite3-journal 63 | 64 | # Flask stuff: 65 | instance/ 66 | .webassets-cache 67 | 68 | # Scrapy stuff: 69 | .scrapy 70 | 71 | # Sphinx documentation 72 | docs/_build/ 73 | 74 | # PyBuilder 75 | .pybuilder/ 76 | target/ 77 | 78 | # Jupyter Notebook 79 | .ipynb_checkpoints 80 | 81 | # IPython 82 | profile_default/ 83 | ipython_config.py 84 | 85 | # pyenv 86 | # For a library or package, you might want to ignore these files since the code is 87 | # intended to run in multiple environments; otherwise, check them in: 88 | # .python-version 89 | 90 | # pipenv 91 | # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. 92 | # However, in case of collaboration, if having platform-specific dependencies or dependencies 93 | # having no cross-platform support, pipenv may install dependencies that don't work, or not 94 | # install all needed dependencies. 95 | #Pipfile.lock 96 | 97 | # UV 98 | # Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control. 99 | # This is especially recommended for binary packages to ensure reproducibility, and is more 100 | # commonly ignored for libraries. 101 | #uv.lock 102 | 103 | # poetry 104 | # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control. 105 | # This is especially recommended for binary packages to ensure reproducibility, and is more 106 | # commonly ignored for libraries. 107 | # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control 108 | #poetry.lock 109 | 110 | # pdm 111 | # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control. 112 | #pdm.lock 113 | # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it 114 | # in version control. 115 | # https://pdm.fming.dev/latest/usage/project/#working-with-version-control 116 | .pdm.toml 117 | .pdm-python 118 | .pdm-build/ 119 | 120 | # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm 121 | __pypackages__/ 122 | 123 | # Celery stuff 124 | celerybeat-schedule 125 | celerybeat.pid 126 | 127 | # SageMath parsed files 128 | *.sage.py 129 | 130 | # Environments 131 | .env 132 | .venv 133 | env/ 134 | venv/ 135 | ENV/ 136 | env.bak/ 137 | venv.bak/ 138 | 139 | # Spyder project settings 140 | .spyderproject 141 | .spyproject 142 | 143 | # Rope project settings 144 | .ropeproject 145 | 146 | # mkdocs documentation 147 | /site 148 | 149 | # mypy 150 | .mypy_cache/ 151 | .dmypy.json 152 | dmypy.json 153 | 154 | # Pyre type checker 155 | .pyre/ 156 | 157 | # pytype static type analyzer 158 | .pytype/ 159 | 160 | # Cython debug symbols 161 | cython_debug/ 162 | 163 | # PyCharm 164 | # JetBrains specific template is maintained in a separate JetBrains.gitignore that can 165 | # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore 166 | # and can be added to the global gitignore or merged into this file. For a more nuclear 167 | # option (not recommended) you can uncomment the following to ignore the entire idea folder. 168 | #.idea/ 169 | 170 | # PyPI configuration file 171 | .pypirc 172 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # LLM4DistReconfig 2 | 3 | ## A Fine-tuned Large Language Model for Power Distribution Network Reconfiguration 4 | 5 | 🚀 **Accepted at NAACL 2025 Main Track** 6 | 🔗 **Paper:** [LLM4DistReconfig](https://arxiv.org/abs/2501.14960) 7 | 📡 **Developed with Resources from:** [NYU HPC](https://sites.google.com/nyu.edu/nyu-hpc/) 8 | 9 | --- 10 | 11 | ## 🔥 Introduction 12 | **LLM4DistReconfig** is a fine-tuned **Llama 3.1** model designed to solve **grid reconfiguration** tasks for power distribution systems. Our model has been rigorously tested on various network sizes, both individually and combined, and has been evaluated on **unseen network datasets**, including sizes that were both **within** and **outside** of the training distribution. 13 | 14 | We provide a **robust and automated** framework that enables **seamless fine-tuning and evaluation** of the model while allowing for easy modifications to adapt to different requirements. This repository contains: 15 | 16 | - **Pre-configured Python notebooks** for dataset generation, model training, and evaluation. 17 | - **Automated scripts** for preparing datasets and fine-tuning models. 18 | - **Customizable loss functions** to improve model performance and adaptability. 19 | 20 | --- 21 | 22 | ## 📌 Requirements 23 | To run the code, install the required dependencies: 24 | ```bash 25 | pip install torch accelerate bitsandbytes peft transformers trl 26 | ``` 27 | 28 | --- 29 | 30 | ## 📂 Datasets 31 | ### 🔗 **Accessing Data** 32 | The dataset files can be found at [grid-datasets](https://github.com/panaschristou/grid-datasets). Download and place them inside a folder named `csv_files` within `Dataset-Notebooks`. If the folder does not exist, create it and add the CSV files. 33 | 34 | ### 📜 **Dataset Preparation** 35 | - Inside `Dataset-Notebooks`, you'll find the **dataset-generation-script** notebook, which processes each dataset by: 36 | - Creating the **prompt**, **input**, and **output** for the model. 37 | - Splitting data into **training, validation, and testing** sets. 38 | - Generating **auxiliary files** required for training. 39 | - Combining different dataset sizes into a **single unified dataset**. 40 | 41 | ### 🔄 **MATLAB Data Conversion** 42 | Since our datasets were generated using **MATPOWER** in MATLAB, we provide a **MATLAB-to-Python conversion script** to easily transform `.mat` files into the required format for dataset generation. This ensures a **smooth workflow** for integrating custom datasets. 43 | 44 | --- 45 | 46 | ## 🎯 Fine-tuning 47 | ### 📌 **Setup** 48 | Navigate to the `Model-Notebooks` folder, where you will find templates for fine-tuning Llama 3.1 on your dataset. Before starting, ensure that: 49 | - Your dataset files are **fully prepared**. 50 | - The `.sh` script is modified with the correct **dataset path** and **model path**. 51 | - You specify where to **save the fine-tuned model** and configure relevant **hyperparameters**. 52 | 53 | ### 🔧 **Customizable Hyperparameters** 54 | During fine-tuning, you can adjust: 55 | - **Learning Rate** 56 | - **Loss Function Components:** 57 | - **Invalid Edges Loss**: Penalizes invalid edges in the output. 58 | - **Subgraphs Loss**: Penalizes disconnected subgraphs. 59 | - **Cycles Loss**: Penalizes cycles in the reconfigured grid. 60 | - You can use **any combination** of these losses to tailor the training process. 61 | 62 | --- 63 | 64 | ## 📊 Model Evaluation 65 | ### 🚀 **Evaluation Workflow** 66 | We provide templates in `Model-Notebooks` to evaluate your trained model. You can: 67 | - Load the **fine-tuned model** or a baseline model from **Hugging Face** for comparison. 68 | - Specify the **number of samples** for evaluation. 69 | - Save results in the `evaluations` folder as: 70 | - **Text responses** (model outputs) 71 | - **Metrics in CSV format** 72 | 73 | ### 📈 **Precomputed Baselines** 74 | For easier comparison, we provide scripts to evaluate standard models such as **Falcon, Mistral, and Llama** against your fine-tuned version. 75 | 76 | ### ⚡ **Alternative Evaluation Approach** 77 | Inside `Dataset-Notebooks`, we include a step-by-step evaluation script that allows you to compute metrics **without queueing a job**, providing a more interactive debugging experience. 78 | 79 | --- 80 | 81 | ## 🎯 Why Use LLM4DistReconfig? 82 | ✔ **Fully Automated Pipeline** – From dataset processing to model evaluation. 83 | ✔ **Highly Customizable** – Modify loss functions, hyperparameters, and datasets with ease. 84 | ✔ **Supports Multiple Architectures** – Compare results with various transformer models. 85 | ✔ **Optimized for Power Grids** – Specifically designed for distribution network reconfiguration. 86 | 87 | --- 88 | 89 | ## 🏆 Acknowledgments 90 | We extend our gratitude to **NYU HPC** for their continuous support in resolving issues and allocating GPU resources that made this research possible. 91 | 92 | --- 93 | 94 | ## 🚀 Get Started 95 | Clone the repository and start training your own LLM for power grid reconfiguration! 96 | ```bash 97 | git clone https://github.com/panaschristou/LLM4DistReconfig.git 98 | cd LLM4DistReconfig 99 | ``` 100 | 101 | Let’s **reconfigure the grid with AI!** ⚡🤖 102 | -------------------------------------------------------------------------------- /Dataset-Notebooks/mat_pyConvert.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": null, 6 | "metadata": { 7 | "colab": { 8 | "base_uri": "https://localhost:8080/" 9 | }, 10 | "executionInfo": { 11 | "elapsed": 19515, 12 | "status": "ok", 13 | "timestamp": 1716555805703, 14 | "user": { 15 | "displayName": "Panayiotis Christou", 16 | "userId": "08170992695377941087" 17 | }, 18 | "user_tz": 240 19 | }, 20 | "id": "vP03AZAUsh2v", 21 | "outputId": "d6677c8b-2dbe-4b3e-9da7-07634170bb03" 22 | }, 23 | "outputs": [], 24 | "source": [ 25 | "from google.colab import drive\n", 26 | "drive.mount('/content/drive')" 27 | ] 28 | }, 29 | { 30 | "cell_type": "code", 31 | "execution_count": null, 32 | "metadata": { 33 | "id": "kTViZRUFsTcw" 34 | }, 35 | "outputs": [], 36 | "source": [ 37 | "import scipy.io\n", 38 | "import pandas as pd\n", 39 | "import numpy as np\n", 40 | "\n", 41 | "# Load the MATLAB file\n", 42 | "mat_data = scipy.io.loadmat('path/to/your/file.mat')\n", 43 | "\n", 44 | "# Access the cell array\n", 45 | "cell_array = mat_data['samples_#bus'] # Get the cell array of the samples of the # (33, 69, etc.) buses dataset\n", 46 | "\n", 47 | "# Extract the column headers\n", 48 | "column_headers = cell_array[0, :]\n" 49 | ] 50 | }, 51 | { 52 | "cell_type": "code", 53 | "execution_count": null, 54 | "metadata": { 55 | "id": "luixrrY6sTcx" 56 | }, 57 | "outputs": [], 58 | "source": [ 59 | "column_headers = ['buses','lines', 'line_impedances','cur_config' ,'cur_connectivity','cur_volt',\n", 60 | " 'cur_loss','upd_config', 'upd_connectivity','upd_volt','upd_loss']\n" 61 | ] 62 | }, 63 | { 64 | "cell_type": "code", 65 | "execution_count": null, 66 | "metadata": { 67 | "colab": { 68 | "base_uri": "https://localhost:8080/" 69 | }, 70 | "executionInfo": { 71 | "elapsed": 111, 72 | "status": "ok", 73 | "timestamp": 1716555856700, 74 | "user": { 75 | "displayName": "Panayiotis Christou", 76 | "userId": "08170992695377941087" 77 | }, 78 | "user_tz": 240 79 | }, 80 | "id": "IWskqaj9sTcx", 81 | "outputId": "dc3fd8e0-8cd2-4f0e-fbff-bd70c7e55939" 82 | }, 83 | "outputs": [], 84 | "source": [ 85 | "cell_array[1:, :].shape" 86 | ] 87 | }, 88 | { 89 | "cell_type": "code", 90 | "execution_count": null, 91 | "metadata": { 92 | "colab": { 93 | "base_uri": "https://localhost:8080/" 94 | }, 95 | "executionInfo": { 96 | "elapsed": 6663, 97 | "status": "ok", 98 | "timestamp": 1716555874974, 99 | "user": { 100 | "displayName": "Panayiotis Christou", 101 | "userId": "08170992695377941087" 102 | }, 103 | "user_tz": 240 104 | }, 105 | "id": "8hdqLZYHsTcy", 106 | "outputId": "8aea5ba2-fb8c-420a-e15e-b9e010fdf302" 107 | }, 108 | "outputs": [], 109 | "source": [ 110 | "\n", 111 | "# Initialize a list to hold the data rows\n", 112 | "data_rows = []\n", 113 | "\n", 114 | "# Iterate over the rows of the cell array starting from the second row\n", 115 | "for row in cell_array[1:, :]:\n", 116 | " data_row = []\n", 117 | " for item in row:\n", 118 | " # Convert MATLAB cell array elements to appropriate Python types\n", 119 | " if isinstance(item, np.ndarray):\n", 120 | " if item.size == 1:\n", 121 | " data_row.append(item.item())\n", 122 | " else:\n", 123 | " data_row.append(item.tolist())\n", 124 | " else:\n", 125 | " data_row.append(item)\n", 126 | " data_rows.append(data_row)\n", 127 | "\n", 128 | "# Create a DataFrame\n", 129 | "df = pd.DataFrame(data_rows, columns=column_headers)\n", 130 | "\n", 131 | "# Display the DataFrame\n", 132 | "print(df.head())\n" 133 | ] 134 | }, 135 | { 136 | "cell_type": "code", 137 | "execution_count": null, 138 | "metadata": { 139 | "id": "yGRTWIVX3dSU" 140 | }, 141 | "outputs": [], 142 | "source": [ 143 | "for column in df.columns:\n", 144 | " if column == 'existing_system_loss' or column == 'updated_system_loss':\n", 145 | " continue\n", 146 | " shape = np.shape(df[column][0])\n", 147 | " if len(shape) > 1:\n", 148 | " if shape[1] == 1:\n", 149 | " df[column] = df[column].apply(lambda x: [item for sublist in x for item in sublist])\n", 150 | " elif shape[1] == 2:\n", 151 | " df[column] = df[column].apply(lambda x: [tuple(sublist) for sublist in x])" 152 | ] 153 | }, 154 | { 155 | "cell_type": "code", 156 | "execution_count": null, 157 | "metadata": { 158 | "id": "yST6Pg-lsTcy" 159 | }, 160 | "outputs": [], 161 | "source": [ 162 | "df.to_csv('path/to/your/csvfile.csv')" 163 | ] 164 | } 165 | ], 166 | "metadata": { 167 | "colab": { 168 | "provenance": [] 169 | }, 170 | "kernelspec": { 171 | "display_name": "Python 3 (ipykernel)", 172 | "language": "python", 173 | "name": "python3" 174 | }, 175 | "language_info": { 176 | "codemirror_mode": { 177 | "name": "ipython", 178 | "version": 3 179 | }, 180 | "file_extension": ".py", 181 | "mimetype": "text/x-python", 182 | "name": "python", 183 | "nbconvert_exporter": "python", 184 | "pygments_lexer": "ipython3", 185 | "version": "3.11.7" 186 | } 187 | }, 188 | "nbformat": 4, 189 | "nbformat_minor": 4 190 | } 191 | -------------------------------------------------------------------------------- /Dataset-Notebooks/generate_samples_script.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": null, 6 | "id": "15a9eaa5-68ea-4ede-8500-2892ca3bb459", 7 | "metadata": {}, 8 | "outputs": [], 9 | "source": [ 10 | "import torch\n", 11 | "from datasets import load_dataset, Dataset\n", 12 | "from peft import LoraConfig, AutoPeftModelForCausalLM\n", 13 | "from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig, TrainingArguments\n", 14 | "from trl import SFTTrainer\n", 15 | "import os\n", 16 | "import re\n", 17 | "import sys" 18 | ] 19 | }, 20 | { 21 | "cell_type": "code", 22 | "execution_count": null, 23 | "id": "170a4547-28ef-421c-b250-f8e25316bcac", 24 | "metadata": {}, 25 | "outputs": [], 26 | "source": [ 27 | "sys.path.append(os.path.abspath('/path/to/LLM-Reconfiguration/Dataset-Notebooks/utils'))\n", 28 | "\n", 29 | "from dataset_utils import prepare_train_data\n", 30 | "from model_utils import get_model, get_tokenizer\n", 31 | "from generation_utils import *" 32 | ] 33 | }, 34 | { 35 | "cell_type": "code", 36 | "execution_count": null, 37 | "id": "a0228c8e-7aca-441c-a6fb-21057b7bd1b0", 38 | "metadata": {}, 39 | "outputs": [], 40 | "source": [ 41 | "from huggingface_hub import login\n", 42 | "\n", 43 | "access_token = 'hf_token'\n", 44 | "login(token=access_token)" 45 | ] 46 | }, 47 | { 48 | "cell_type": "code", 49 | "execution_count": null, 50 | "id": "e6634620-65ee-4c0c-9d64-8a56663253e0", 51 | "metadata": {}, 52 | "outputs": [], 53 | "source": [ 54 | "os.getcwd()" 55 | ] 56 | }, 57 | { 58 | "cell_type": "code", 59 | "execution_count": null, 60 | "id": "cc539791-ca4e-4b9c-82a2-b561108170da", 61 | "metadata": {}, 62 | "outputs": [], 63 | "source": [ 64 | "os.cwd /path/to/LLM-Reconfiguration/Dataset-Notebooks" 65 | ] 66 | }, 67 | { 68 | "cell_type": "code", 69 | "execution_count": null, 70 | "id": "97683290-0fde-49c5-8f93-08a4b9b61a18", 71 | "metadata": {}, 72 | "outputs": [], 73 | "source": [ 74 | "data_path=\"/path/to/LLM-Reconfiguration/Dataset-Notebooks/train_files/train_33_nodes.csv\"\n", 75 | "model_id=\"/path/to/LLM-Reconfiguration/AutoTrain/model_path\"" 76 | ] 77 | }, 78 | { 79 | "cell_type": "code", 80 | "execution_count": null, 81 | "id": "081a3a07-ceb3-44ca-92d0-7003a9a6e2ad", 82 | "metadata": {}, 83 | "outputs": [], 84 | "source": [ 85 | "train_dataset, validation_dataset, test_dataset = prepare_train_data(data_path)" 86 | ] 87 | }, 88 | { 89 | "cell_type": "code", 90 | "execution_count": null, 91 | "id": "e4595e69-554e-4582-be7e-c8999309cf20", 92 | "metadata": {}, 93 | "outputs": [], 94 | "source": [ 95 | "model = get_model(model_id)\n", 96 | "tokenizer = get_tokenizer(model_id)" 97 | ] 98 | }, 99 | { 100 | "cell_type": "code", 101 | "execution_count": null, 102 | "id": "e481a82f-e565-48cf-a87a-106b39c0f965", 103 | "metadata": {}, 104 | "outputs": [], 105 | "source": [ 106 | "peft_config = LoraConfig(\n", 107 | " r=8, lora_alpha=16, lora_dropout=0.05, bias=\"none\", task_type=\"CAUSAL_LM\"\n", 108 | " )" 109 | ] 110 | }, 111 | { 112 | "cell_type": "code", 113 | "execution_count": null, 114 | "id": "32bf58e8-381f-4101-939d-9880376a1966", 115 | "metadata": {}, 116 | "outputs": [], 117 | "source": [ 118 | "model_path = \"/path/to/LLM-Reconfiguration/AutoTrain/llama2/llama2-grid-reconfiguration-10epoch-RP-AP5-84N-IEL-SUL-CYL/checkpoint-14600\"\n", 119 | "\n", 120 | "model = peft_merge_unload(model_id, model_path)" 121 | ] 122 | }, 123 | { 124 | "cell_type": "code", 125 | "execution_count": null, 126 | "id": "2888942b-964f-4de7-8153-0af0e2074232", 127 | "metadata": {}, 128 | "outputs": [], 129 | "source": [ 130 | "# generate_response(user_input=test_dataset['prompt'][0], model=model, tokenizer=tokenizer)" 131 | ] 132 | }, 133 | { 134 | "cell_type": "code", 135 | "execution_count": null, 136 | "id": "fd882950-4a23-4392-9100-8e34a4885c76", 137 | "metadata": {}, 138 | "outputs": [], 139 | "source": [ 140 | "from functools import partial\n", 141 | "\n", 142 | "# Create a partial function with fixed model and tokenizer\n", 143 | "partial_generate_response = partial(generate_response, model=model, tokenizer=tokenizer, max_new_tokens=900)" 144 | ] 145 | }, 146 | { 147 | "cell_type": "code", 148 | "execution_count": null, 149 | "id": "acbbbb36-1cea-421a-9491-8fe3de43bf31", 150 | "metadata": {}, 151 | "outputs": [], 152 | "source": [ 153 | "generate_and_save_responses(test_dataset, partial_generate_response, num_samples=10, filename=\"/path/to/LLM-Reconfiguration/Dataset-Notebooks/generated_samples/model_id-#samples.txt\")" 154 | ] 155 | }, 156 | { 157 | "cell_type": "code", 158 | "execution_count": null, 159 | "id": "7ace23af-b58a-40c3-83d4-80a99cdf2e3f", 160 | "metadata": {}, 161 | "outputs": [], 162 | "source": [] 163 | } 164 | ], 165 | "metadata": { 166 | "kernelspec": { 167 | "display_name": "my_env", 168 | "language": "python", 169 | "name": "my_env" 170 | }, 171 | "language_info": { 172 | "codemirror_mode": { 173 | "name": "ipython", 174 | "version": 3 175 | }, 176 | "file_extension": ".py", 177 | "mimetype": "text/x-python", 178 | "name": "python", 179 | "nbconvert_exporter": "python", 180 | "pygments_lexer": "ipython3", 181 | "version": "3.12.3" 182 | } 183 | }, 184 | "nbformat": 4, 185 | "nbformat_minor": 5 186 | } 187 | -------------------------------------------------------------------------------- /Dataset-Notebooks/utils/model_utils.py: -------------------------------------------------------------------------------- 1 | import torch 2 | from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig, TrainingArguments 3 | import re 4 | import ast 5 | import networkx as nx 6 | 7 | 8 | def get_model_and_tokenizer(model_id): 9 | 10 | tokenizer = AutoTokenizer.from_pretrained(model_id) 11 | tokenizer.pad_token = tokenizer.eos_token 12 | bnb_config = BitsAndBytesConfig( 13 | load_in_4bit=True, bnb_4bit_quant_type="nf4", bnb_4bit_compute_dtype="float16", bnb_4bit_use_double_quant=True 14 | ) 15 | model = AutoModelForCausalLM.from_pretrained( 16 | model_id, 17 | quantization_config=bnb_config, 18 | device_map="auto" 19 | ) 20 | model.config.use_cache=False 21 | model.config.pretraining_tp=1 22 | return model, tokenizer 23 | 24 | def get_model(model_id): 25 | 26 | bnb_config = BitsAndBytesConfig( 27 | load_in_4bit=True, bnb_4bit_quant_type="nf4", bnb_4bit_compute_dtype="float16", bnb_4bit_use_double_quant=True 28 | ) 29 | 30 | model = AutoModelForCausalLM.from_pretrained( 31 | model_id, 32 | quantization_config=bnb_config, 33 | device_map="auto" 34 | ) 35 | 36 | model.config.use_cache=False 37 | model.config.pretraining_tp=1 38 | return model 39 | 40 | def get_tokenizer(model_id): 41 | 42 | tokenizer = AutoTokenizer.from_pretrained(model_id) 43 | tokenizer.pad_token = tokenizer.eos_token 44 | 45 | return tokenizer 46 | 47 | def parse_open_lines(output_string): 48 | """ 49 | Parses the open lines from the output string. 50 | 51 | Parameters: 52 | - output_string: The string containing the open lines information. 53 | 54 | Returns: 55 | A list of tuples representing the open lines. 56 | """ 57 | # Regular expression to find the "Open Lines" part 58 | open_lines_pattern = r'Open Lines=\[(.*?)\]' 59 | 60 | # Search for the pattern in the string 61 | match = re.search(open_lines_pattern, output_string) 62 | 63 | if match: 64 | open_lines_str = match.group(1) 65 | 66 | # Remove any extraneous characters and ensure proper format 67 | open_lines_str = re.sub(r'[^0-9,() ]', '', open_lines_str) # Remove invalid characters 68 | open_lines_str = re.sub(r'\s+', '', open_lines_str) # Remove extra whitespace 69 | open_lines_str = open_lines_str.strip(',') # Remove trailing commas 70 | 71 | # Ensure that open_lines_str is properly formatted for evaluation 72 | try: 73 | open_lines = ast.literal_eval(f'[{open_lines_str}]') 74 | except (ValueError, SyntaxError) as e: 75 | print(f"Error parsing open lines: {e}") 76 | return [] 77 | 78 | return open_lines 79 | else: 80 | return [] 81 | 82 | 83 | def parse_available_lines(output_string): 84 | # Regular expression to find the "Lines" part in the prompt which represents the available lines 85 | open_lines_pattern = r'Lines=\[(.*?)\]' 86 | 87 | # Search for the pattern in the string 88 | match = re.search(open_lines_pattern, output_string) 89 | 90 | if match: 91 | available_lines_str = match.group(1) 92 | # Convert the string representation of the list to an actual list 93 | available_lines = ast.literal_eval(f'[{available_lines_str}]') 94 | return available_lines 95 | else: 96 | return [] 97 | 98 | 99 | def get_output_graph_edges(predicted_lines, available_lines): 100 | predicted_lines_reverse = reverseTuple(predicted_lines) 101 | predicted_lines.extend(predicted_lines_reverse) 102 | return [line for line in available_lines if line not in predicted_lines] 103 | 104 | 105 | 106 | def compute_invalid_edges_loss(predicted_lines, available_lines): 107 | # Calculate the loss for invalid edges 108 | invalid_edges_loss = torch.tensor(0.0) 109 | for line in predicted_lines: 110 | if line not in available_lines: 111 | invalid_edges_loss += 1.0 # Adjust the penalty as needed 112 | return invalid_edges_loss 113 | 114 | def compute_cycles_loss(predicted_lines): 115 | # Calculate the loss for cycles 116 | G = nx.Graph() 117 | G.add_edges_from(predicted_lines) 118 | cycles_loss = torch.tensor(0.0) 119 | try: 120 | cycles = list(nx.find_cycle(G, orientation="ignore")) 121 | cycles_loss += len(cycles) # Adjust the penalty as needed 122 | except nx.NetworkXNoCycle: 123 | pass 124 | return cycles_loss 125 | 126 | 127 | def compute_subgraphs_loss(predicted_lines): 128 | # Calculate the loss for subgraphs 129 | G = nx.Graph() 130 | G.add_edges_from(predicted_lines) 131 | subgraphs_loss = torch.tensor(0.0) 132 | print('Number of connected components: ', nx.number_connected_components(G)) #remove when training properly 133 | if nx.number_connected_components(G) > 1: 134 | subgraphs_loss += nx.number_connected_components(G) - 1 # Adjust the penalty as needed 135 | return subgraphs_loss 136 | 137 | def reverseTuple(lstOfTuple): 138 | return [tup[::-1] for tup in lstOfTuple] 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | -------------------------------------------------------------------------------- /Dataset-Notebooks/utils/generation_utils.py: -------------------------------------------------------------------------------- 1 | import torch 2 | from transformers import GenerationConfig 3 | from time import perf_counter 4 | import re 5 | from peft import AutoPeftModelForCausalLM, PeftModel 6 | from transformers import AutoModelForCausalLM 7 | 8 | def generate_response(user_input, model, tokenizer, max_new_tokens, penalty_alpha=0.6, do_sample=True, top_k=5, temperature=0.5, repetition_penalty=1.2, skip_special_tokens=True): 9 | 10 | prompt = formatted_prompt(user_input) 11 | 12 | inputs = tokenizer([prompt], return_tensors="pt") 13 | 14 | generation_config = GenerationConfig( 15 | penalty_alpha=penalty_alpha, 16 | do_sample = do_sample, 17 | top_k=top_k, 18 | temperature=temperature, 19 | repetition_penalty=repetition_penalty, 20 | max_new_tokens=max_new_tokens, 21 | pad_token_id=tokenizer.eos_token_id, 22 | eos_token_id=tokenizer.eos_token_id # Ensure EOS token is set - This is a new parameter so maybe it breaks the code. 23 | ) 24 | start_time = perf_counter() 25 | 26 | inputs = tokenizer(prompt, return_tensors="pt").to('cuda') 27 | 28 | outputs = model.generate(**inputs, generation_config=generation_config) 29 | response = tokenizer.decode(outputs[0], skip_special_tokens=skip_special_tokens) 30 | output_time = perf_counter() - start_time 31 | return response, output_time 32 | 33 | 34 | def formatted_prompt(question)-> str: 35 | return f"<|user|>\n{question}\n<|assistant|>" 36 | 37 | 38 | 39 | def extract_output_data(response): 40 | """ 41 | Extracts the output data related to the open lines, node voltages, and system loss from the response string. 42 | 43 | Parameters: 44 | - response: The full response string from which to extract the output data. 45 | 46 | Returns: 47 | A dictionary containing the extracted output data. 48 | """ 49 | # Regular expression to match the output section 50 | output_pattern = re.compile( 51 | r"Open Lines=\[(.*?)\],\s*(?:Node Voltages|Network Variables: NodeVoltages)=\[(.*?)\],\s*System Loss=(\d+\.\d+)" 52 | ) 53 | 54 | # Search for the output pattern in the response 55 | match = output_pattern.search(response) 56 | 57 | if match: 58 | # Extract groups from the match 59 | open_lines = match.group(1) 60 | node_voltages = match.group(2) 61 | system_loss = match.group(3) 62 | 63 | # Debugging prints 64 | print(f"Extracted open lines: {open_lines}") 65 | print(f"Extracted node voltages: {node_voltages}") 66 | print(f"Extracted system loss: {system_loss}") 67 | 68 | # Fix any missing parentheses for the first and last open lines 69 | if not open_lines.startswith('('): 70 | open_lines = '(' + open_lines 71 | if not open_lines.endswith(')'): 72 | open_lines = open_lines + ')' 73 | 74 | # Properly format the open_lines string to remove extra characters 75 | try: 76 | open_lines_list = [tuple(map(int, line.split(','))) for line in re.findall(r'\((\d+,\s*\d+)\)', open_lines)] 77 | except ValueError as e: 78 | print(f"Error processing open lines: {e}") 79 | open_lines_list = [] 80 | 81 | try: 82 | node_voltages_list = [float(voltage.strip()) for voltage in node_voltages.split(',')] 83 | except ValueError as e: 84 | print(f"Error processing node voltages: {e}") 85 | node_voltages_list = [] 86 | 87 | # Debugging prints 88 | print(f"Formatted open lines list: {open_lines_list}") 89 | print(f"Formatted node voltages list: {node_voltages_list}") 90 | 91 | # Return the extracted data in a structured format 92 | return { 93 | 'Open Lines': open_lines_list, 94 | 'Node Voltages': node_voltages_list, 95 | 'System Loss': float(system_loss) 96 | } 97 | else: 98 | # Debugging print 99 | print(f"No match found in response: {response}") 100 | return "No output data found in the response." 101 | 102 | 103 | 104 | 105 | 106 | 107 | def generate_and_save_responses(dataset, response_function, num_samples=10, filename="responses.txt"): 108 | """ 109 | Generates responses for randomly selected prompts from the dataset, includes the correct output, 110 | and saves them to a file with clear separation between each sample. 111 | 112 | Parameters: 113 | - dataset: The dataset containing the prompts and correct outputs. 114 | - response_function: The function to generate responses. 115 | - num_samples: The number of random samples to generate. 116 | - filename: The name of the file where the responses will be saved. 117 | """ 118 | # Ensure dataset has enough entries 119 | if num_samples > len(dataset): 120 | raise ValueError("The number of samples requested exceeds the dataset size.") 121 | 122 | # Generate random indices 123 | indices = torch.randint(0, len(dataset), (num_samples,)) 124 | 125 | # Open the file to write the responses 126 | with open(filename, "w") as file: 127 | for index in indices: 128 | # Extract the prompt and correct output using the random index 129 | prompt = dataset['prompt'][index] 130 | correct_output = dataset['output'][index] 131 | 132 | # Generate the response 133 | response, output_time = response_function(user_input=prompt) 134 | 135 | reformatted_response = extract_output_data(response) 136 | 137 | # Write the prompt, response, and correct output to the file with clear separation 138 | file.write("---- Sample Start ----\n") 139 | file.write(f"Prompt:\n {prompt}\n") 140 | file.write(f"Response:\n {reformatted_response}\n") 141 | file.write(f"Correct Output:\n {correct_output}\n") 142 | file.write(f"Inference Time: {output_time}\n") 143 | file.write("---- Sample End ----\n\n") 144 | 145 | 146 | def peft_merge_unload(model_id,model_path, torch_dtype=torch.float16, load_in_8bit=False, device_map="auto", trust_remote_code=True, from_transformers=True): 147 | 148 | model = AutoModelForCausalLM.from_pretrained(pretrained_model_name_or_path = model_id, 149 | torch_dtype=torch_dtype, 150 | load_in_8bit=load_in_8bit, 151 | device_map=device_map, 152 | trust_remote_code=trust_remote_code) 153 | 154 | peft_model = PeftModel.from_pretrained(model = model, model_id=model_path, from_transformers=from_transformers, device_map=device_map) 155 | 156 | model = peft_model.merge_and_unload() 157 | return model 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | -------------------------------------------------------------------------------- /Dataset-Notebooks/utils/dataset_utils.py: -------------------------------------------------------------------------------- 1 | from datasets import load_dataset, Dataset 2 | import ast 3 | import pickle 4 | import numpy as np 5 | import pandas as pd 6 | import glob as glob 7 | 8 | def clean_value(value): 9 | # Function to remove square brackets and convert string representation of lists to actual lists 10 | 11 | try: 12 | return ast.literal_eval(value) 13 | except (ValueError, SyntaxError): 14 | return value 15 | 16 | def modify_and_save(file_path, set_value, df_column, output_file_path): 17 | file_path = file_path 18 | df = pd.read_csv(file_path) 19 | specific_value = set_value 20 | df[df_column] = specific_value 21 | output_file_path = output_file_path 22 | df.to_csv(output_file_path, index=False) 23 | 24 | def convert_to_dict(data): 25 | # Convert each row into a dictionary 26 | data_dict_list = [] 27 | for _, row in data.iterrows(): 28 | entry = {column: clean_value(value) for column, value in row.items()} 29 | data_dict_list.append(entry) 30 | return data_dict_list 31 | 32 | def dict_to_pickle(data_dict_list, output_file_path): 33 | # Save the list of dictionaries to a Pickle file 34 | file_path = output_file_path 35 | with open(file_path, 'wb') as pickle_file: 36 | pickle.dump(data_dict_list, pickle_file) 37 | print(f"Data successfully saved to {output_file_path}") 38 | 39 | def load_pickle(file_path): 40 | with open(file_path, 'rb') as f: 41 | data = pickle.load(f) 42 | return data 43 | 44 | 45 | def create_inputs(data): 46 | # Function to create text inputs 47 | inputs = [] 48 | for entry in data: 49 | input = ( 50 | f"Power Distribution Network: Busses={entry['buses']}, Lines={entry['lines']}, " 51 | f"Line Impedances={entry['line_impedances']}, Open Lines={entry['existing_open_lines']}\n" 52 | f"Network Variables: NodeVoltages={entry['existing_node_voltages']}, " 53 | f"System Loss={entry['existing_system_loss']}, System Load={entry['system_load']}\n" 54 | ) 55 | inputs.append(input) 56 | return inputs 57 | 58 | 59 | def create_outputs(data): 60 | # Function to create text outputs 61 | outputs = [] 62 | for entry in data: 63 | output = ( 64 | f"Output: Open Lines={entry['updated_open_lines']}, " 65 | f"Node Voltages={entry['updated_node_voltages']}, System Loss={entry['updated_system_loss']}\n" 66 | ) 67 | outputs.append(output) 68 | return outputs 69 | 70 | def save_to_txt(file_path, entries): 71 | with open(file_path, 'w') as f: 72 | for entry in entries: 73 | f.write(entry + '') 74 | 75 | 76 | def load_entries(file_path): 77 | # Function to load prompts from the text file 78 | with open(file_path, 'r') as f: 79 | entries = f.read().strip().split('') 80 | 81 | entries.pop() 82 | return entries 83 | 84 | def create_task_descriptions(task_description, inputs): 85 | task_descriptions = [task_description] * len(inputs) 86 | return task_descriptions 87 | 88 | def create_prompts(task_descriptions, inputs): 89 | prompts = [desc + "\n" + inp for desc, inp in zip(task_descriptions, inputs)] 90 | return prompts 91 | 92 | def create_train_df(task_descriptions, inputs, prompts, outputs): 93 | train_data = {'Task Description': task_descriptions, 'input': inputs, 'prompt': prompts,'output': outputs} 94 | train_df = pd.DataFrame(train_data) 95 | return train_df 96 | 97 | def generate_random_split(train_df): 98 | num_samples = len(train_df) 99 | 100 | # Generate random splits 101 | np.random.seed(42) # For reproducibility 102 | split_values = ['train'] * (num_samples // 3) + ['test'] * (num_samples // 3) + ['validation'] * (num_samples // 3) 103 | 104 | # If there are remaining samples, assign them randomly 105 | remainder = num_samples - len(split_values) 106 | split_values += np.random.choice(['train', 'test', 'validation'], size=remainder).tolist() 107 | 108 | # Shuffle the split assignments 109 | np.random.shuffle(split_values) 110 | 111 | # Add the split column to the DataFrame 112 | train_df['split'] = split_values 113 | 114 | def combine_csv_files(file_paths, output_file_path): 115 | """ 116 | Combines multiple CSV files into a single DataFrame and resets the index. 117 | 118 | Parameters: 119 | - file_paths: List of file paths to the CSV files to be combined. 120 | - output_file_path: Path where the combined CSV file will be saved. 121 | """ 122 | # Initialize an empty list to store individual DataFrames 123 | data_frames = [] 124 | 125 | # Read each file and append the DataFrame to the list 126 | for file_path in file_paths: 127 | df = pd.read_csv(file_path) 128 | data_frames.append(df) 129 | 130 | # Concatenate all DataFrames in the list into a single DataFrame 131 | combined_df = pd.concat(data_frames, ignore_index=True) 132 | 133 | # Reset the index to ensure unique indices 134 | combined_df.reset_index(drop=True, inplace=True) 135 | 136 | # Save the combined DataFrame to a CSV file 137 | combined_df.to_csv(output_file_path, index=False) 138 | print(f"Combined CSV saved to {output_file_path}") 139 | 140 | def formatted_train(input,response)->str: 141 | return f"<|user|>\n{input}\n<|assistant|>\n{response}" 142 | 143 | 144 | def prepare_train_data(data_path): 145 | dataset = load_dataset('csv', data_files=data_path) 146 | print(dataset) 147 | 148 | # Filter the dataset for the 'train', 'validation', and 'test' splits 149 | train_dataset = dataset['train'].filter(lambda x: x['split'] == 'train') 150 | validation_dataset = dataset['train'].filter(lambda x: x['split'] == 'validation') 151 | test_dataset = dataset['train'].filter(lambda x: x['split'] == 'test') 152 | 153 | # Print the first entry of each dataset to verify 154 | print(train_dataset[0]['split']) 155 | print(validation_dataset[0]['split']) 156 | print(test_dataset[0]['split']) 157 | 158 | # Remove the 'split' column as it's no longer needed 159 | train_dataset = train_dataset.remove_columns('split') 160 | validation_dataset = validation_dataset.remove_columns('split') 161 | test_dataset = test_dataset.remove_columns('split') 162 | 163 | train_df = train_dataset.to_pandas() 164 | train_df["text"] = train_df[["prompt", "output"]].apply(lambda x: "<|user|>\n" + x["prompt"] + "\n<|assistant|>\n" + x["output"] + "", axis=1) 165 | train_dataset = Dataset.from_pandas(train_df) 166 | 167 | validation_df = validation_dataset.to_pandas() 168 | validation_df["text"] = validation_df[["prompt", "output"]].apply(lambda x: "<|user|>\n" + x["prompt"] + "\n<|assistant|>\n" + x["output"] + "", axis=1) 169 | validation_dataset = Dataset.from_pandas(validation_df) 170 | 171 | test_df = test_dataset.to_pandas() 172 | test_df["text"] = test_df[["prompt", "output"]].apply(lambda x: "<|user|>\n" + x["prompt"] + "\n<|assistant|>\n" + x["output"] + "", axis=1) 173 | test_dataset = Dataset.from_pandas(test_df) 174 | return train_dataset, validation_dataset, test_dataset -------------------------------------------------------------------------------- /Model-Notebooks/llama2-notebooks/grid-reconfiguration.py: -------------------------------------------------------------------------------- 1 | import argparse 2 | import re 3 | import ast 4 | import networkx as nx 5 | from huggingface_hub import login 6 | import sys 7 | import os 8 | import torch 9 | from datasets import load_dataset, Dataset 10 | from peft import LoraConfig, AutoPeftModelForCausalLM, PeftModel 11 | from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig, TrainingArguments, GenerationConfig 12 | from trl import SFTTrainer 13 | import subprocess as sp 14 | from time import perf_counter 15 | import nvidia_smi 16 | 17 | sys.path.append(os.path.abspath('/path/to/LLM-Reconfiguration/Dataset-Notebooks/utils')) 18 | from dataset_utils import * 19 | from model_utils import * 20 | from generation_utils import * 21 | from monitoring_utils import * 22 | 23 | def parse_args(): 24 | parser = argparse.ArgumentParser(description="Train a language model with specific configurations.") 25 | parser.add_argument('--data_path', type=str, required=True, help='Path to the dataset.') 26 | parser.add_argument('--model_id', type=str, required=True, help='Model ID to use.') 27 | parser.add_argument('--output_model', type=str, required=True, help='Output model path.') 28 | parser.add_argument('--num_train_epochs', type=int, required=True, help='Number of training epochs.') 29 | parser.add_argument('--batch_size', type=int, required=True, help='Batch size per device.') 30 | parser.add_argument('--max_new_tokens', type=int, required=True, help='Maximum number of new tokens generated.') 31 | parser.add_argument('--model_name_hf', type=str, required=True, help='Huggingface model name for upload.') 32 | parser.add_argument('--tokenizer_name_hf', type=str, required=True, help='Huggingface tokenizer name for upload.') 33 | parser.add_argument('--custom_loss', type=int, required=True, help='For regular loss use 0. For custom loss with 3 penalty terms use 1.') 34 | parser.add_argument('--custom_loss_config', type=str, required=True, help='Custom loss configuration.') 35 | parser.add_argument('--cycles_loss_scaling_factor', type=float, required=True, help='Scaling factor for cycles loss') 36 | parser.add_argument('--model_for_generation_path', type=str, required=True, help='Model path to use for generation.') 37 | return parser.parse_args() 38 | 39 | def main(): 40 | args = parse_args() 41 | 42 | print('Training configurations: \n', args) 43 | 44 | access_token = 'hf_token' 45 | login(token=access_token) 46 | 47 | os.getcwd() 48 | 49 | data_path = args.data_path 50 | model_id = args.model_id 51 | output_model = args.output_model 52 | 53 | 54 | train_dataset, validation_dataset, test_dataset = prepare_train_data(data_path) 55 | print(train_dataset) 56 | 57 | 58 | model, tokenizer = get_model_and_tokenizer(model_id) 59 | 60 | get_memory_allocated_cached() 61 | 62 | peft_config = LoraConfig( 63 | r=8, lora_alpha=16, lora_dropout=0.05, bias="none", task_type="CAUSAL_LM" 64 | ) 65 | 66 | training_arguments = TrainingArguments( 67 | output_dir=output_model, 68 | per_device_train_batch_size=args.batch_size, 69 | gradient_accumulation_steps=4, 70 | optim="paged_adamw_32bit", 71 | learning_rate=2e-4, 72 | lr_scheduler_type="cosine", 73 | save_strategy="epoch", 74 | logging_steps=10, 75 | num_train_epochs=args.num_train_epochs, 76 | fp16=True, 77 | report_to="none", 78 | gradient_checkpointing=True 79 | ) 80 | 81 | if args.custom_loss==0: 82 | trainer = SFTTrainer( 83 | model=model, 84 | train_dataset=train_dataset, 85 | peft_config=peft_config, 86 | dataset_text_field="text", 87 | args=training_arguments, 88 | tokenizer=tokenizer, 89 | packing=False, 90 | max_seq_length=4096 91 | ) 92 | 93 | elif args.custom_loss==1: 94 | class CustomTrainer(SFTTrainer): 95 | def compute_loss(self, model, inputs, return_outputs=False): 96 | # Get the model loss 97 | outputs = model(**inputs) 98 | loss = outputs.loss 99 | 100 | # Detokenize inputs and outputs 101 | input_text = self.tokenizer.batch_decode(inputs['input_ids'], skip_special_tokens=True) 102 | output_text = self.tokenizer.batch_decode(outputs.logits.argmax(dim=-1), skip_special_tokens=True) 103 | 104 | # Get available lines and predicted lines and use them to get the outputted graph edges 105 | available_lines = parse_available_lines(input_text[0]) 106 | predicted_lines = parse_open_lines(output_text[0]) 107 | graph_edges = get_output_graph_edges(predicted_lines, available_lines) 108 | print(predicted_lines) 109 | 110 | # Calculate your additional loss terms 111 | if predicted_lines != []: 112 | if "IEL" in args.custom_loss_config: 113 | invalid_edges_loss = compute_invalid_edges_loss(predicted_lines, available_lines)/len(predicted_lines) 114 | if "CYL" in args.custom_loss_config: 115 | cycles_loss = compute_cycles_loss(graph_edges)/len(available_lines) 116 | if "SUL" in args.custom_loss_config: 117 | subgraphs_loss = compute_subgraphs_loss(graph_edges)/len(predicted_lines) 118 | else: 119 | if "IEL" in args.custom_loss_config: 120 | invalid_edges_loss = 1 121 | if "CYL" in args.custom_loss_config: 122 | cycles_loss = 1 123 | if "SUL" in args.custom_loss_config: 124 | subgraphs_loss = 1 125 | 126 | total_loss = loss 127 | # Add the additional loss terms to the main loss 128 | if "IEL" in args.custom_loss_config: 129 | total_loss += invalid_edges_loss 130 | if "CYL" in args.custom_loss_config: 131 | total_loss += cycles_loss * args.cycles_loss_scaling_factor 132 | if "SUL" in args.custom_loss_config: 133 | total_loss += subgraphs_loss 134 | 135 | 136 | if "IEL" in args.custom_loss_config: 137 | print('Invalid edges loss: ', invalid_edges_loss) 138 | if "CYL" in args.custom_loss_config: 139 | print('Cycles Loss: ', cycles_loss) 140 | if "SUL" in args.custom_loss_config: 141 | print('Subgraphs loss: ', subgraphs_loss) 142 | 143 | print('Total loss: ', total_loss.item()) 144 | 145 | return (total_loss, outputs) if return_outputs else total_loss 146 | 147 | 148 | trainer = CustomTrainer( 149 | model=model, 150 | train_dataset=train_dataset, 151 | peft_config=peft_config, 152 | dataset_text_field="text", 153 | args=training_arguments, 154 | tokenizer=tokenizer, 155 | packing=False, 156 | max_seq_length=4096 157 | ) 158 | 159 | 160 | 161 | get_memory_allocated_cached() 162 | 163 | get_cuda_info() 164 | 165 | device = torch.device("cuda" if torch.cuda.is_available() else "cpu") 166 | print("Device: ", device) 167 | 168 | get_gpu_memory() 169 | 170 | get_nvidia_smi_info(0) 171 | 172 | trainer.train() 173 | 174 | model_path = args.model_for_generation_path 175 | 176 | model_with_peft = peft_merge_unload(model_id, model_path) 177 | 178 | print(model) 179 | 180 | model_with_peft.push_to_hub(args.model_name_hf, access_token) 181 | tokenizer.push_to_hub(args.tokenizer_name_hf, access_token) 182 | 183 | generate_response(user_input=test_dataset['prompt'][0], model=model_with_peft, tokenizer =tokenizer) 184 | 185 | if __name__ == "__main__": 186 | main() 187 | -------------------------------------------------------------------------------- /Model-Notebooks/llama3-notebooks/grid-reconfiguration.py: -------------------------------------------------------------------------------- 1 | import argparse 2 | import re 3 | import ast 4 | import networkx as nx 5 | from huggingface_hub import login 6 | import sys 7 | import os 8 | import torch 9 | from datasets import load_dataset, Dataset 10 | from peft import LoraConfig, AutoPeftModelForCausalLM, PeftModel 11 | from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig, TrainingArguments, GenerationConfig 12 | from trl import SFTTrainer 13 | import subprocess as sp 14 | from time import perf_counter 15 | import nvidia_smi 16 | 17 | sys.path.append(os.path.abspath('/path/to/LLM-Reconfiguration/Dataset-Notebooks/utils')) 18 | from dataset_utils import * 19 | from model_utils import * 20 | from generation_utils import * 21 | from monitoring_utils import * 22 | 23 | def parse_args(): 24 | parser = argparse.ArgumentParser(description="Train a language model with specific configurations.") 25 | parser.add_argument('--data_path', type=str, required=True, help='Path to the dataset.') 26 | parser.add_argument('--model_id', type=str, required=True, help='Model ID to use.') 27 | parser.add_argument('--output_model', type=str, required=True, help='Output model path.') 28 | parser.add_argument('--num_train_epochs', type=int, required=True, help='Number of training epochs.') 29 | parser.add_argument('--batch_size', type=int, required=True, help='Batch size per device.') 30 | parser.add_argument('--max_new_tokens', type=int, required=True, help='Maximum number of new tokens generated.') 31 | parser.add_argument('--model_name_hf', type=str, required=True, help='Huggingface model name for upload.') 32 | parser.add_argument('--tokenizer_name_hf', type=str, required=True, help='Huggingface tokenizer name for upload.') 33 | parser.add_argument('--custom_loss', type=int, required=True, help='For regular loss use 0. For custom loss with 3 penalty terms use 1.') 34 | parser.add_argument('--custom_loss_config', type=str, required=True, help='Custom loss configuration.') 35 | parser.add_argument('--cycles_loss_scaling_factor', type=float, required=True, help='Scaling factor for cycles loss') 36 | parser.add_argument('--model_for_generation_path', type=str, required=True, help='Model path to use for generation.') 37 | return parser.parse_args() 38 | 39 | def main(): 40 | args = parse_args() 41 | 42 | print('Training configurations: \n', args) 43 | 44 | access_token = 'hf_token' 45 | login(token=access_token) 46 | 47 | os.getcwd() 48 | 49 | data_path = args.data_path 50 | model_id = args.model_id 51 | output_model = args.output_model 52 | 53 | 54 | train_dataset, validation_dataset, test_dataset = prepare_train_data(data_path) 55 | print(train_dataset) 56 | 57 | 58 | model, tokenizer = get_model_and_tokenizer(model_id) 59 | 60 | get_memory_allocated_cached() 61 | 62 | peft_config = LoraConfig( 63 | r=8, lora_alpha=16, lora_dropout=0.05, bias="none", task_type="CAUSAL_LM" 64 | ) 65 | 66 | training_arguments = TrainingArguments( 67 | output_dir=output_model, 68 | per_device_train_batch_size=args.batch_size, 69 | gradient_accumulation_steps=4, 70 | optim="paged_adamw_32bit", 71 | learning_rate=2e-4, 72 | lr_scheduler_type="cosine", 73 | save_strategy="epoch", 74 | logging_steps=10, 75 | num_train_epochs=args.num_train_epochs, 76 | fp16=True, 77 | report_to="none", 78 | gradient_checkpointing=True 79 | ) 80 | 81 | if args.custom_loss==0: 82 | trainer = SFTTrainer( 83 | model=model, 84 | train_dataset=train_dataset, 85 | peft_config=peft_config, 86 | dataset_text_field="text", 87 | args=training_arguments, 88 | tokenizer=tokenizer, 89 | packing=False, 90 | max_seq_length=4096 91 | ) 92 | 93 | elif args.custom_loss==1: 94 | class CustomTrainer(SFTTrainer): 95 | def compute_loss(self, model, inputs, return_outputs=False): 96 | # Get the model loss 97 | outputs = model(**inputs) 98 | loss = outputs.loss 99 | 100 | # Detokenize inputs and outputs 101 | input_text = self.tokenizer.batch_decode(inputs['input_ids'], skip_special_tokens=True) 102 | output_text = self.tokenizer.batch_decode(outputs.logits.argmax(dim=-1), skip_special_tokens=True) 103 | 104 | # Get available lines and predicted lines and use them to get the outputted graph edges 105 | available_lines = parse_available_lines(input_text[0]) 106 | predicted_lines = parse_open_lines(output_text[0]) 107 | graph_edges = get_output_graph_edges(predicted_lines, available_lines) 108 | print(predicted_lines) 109 | 110 | # Calculate your additional loss terms 111 | if predicted_lines != []: 112 | if "IEL" in args.custom_loss_config: 113 | invalid_edges_loss = compute_invalid_edges_loss(predicted_lines, available_lines)/len(predicted_lines) 114 | if "CYL" in args.custom_loss_config: 115 | cycles_loss = compute_cycles_loss(graph_edges)/len(available_lines) 116 | if "SUL" in args.custom_loss_config: 117 | subgraphs_loss = compute_subgraphs_loss(graph_edges)/len(predicted_lines) 118 | else: 119 | if "IEL" in args.custom_loss_config: 120 | invalid_edges_loss = 1 121 | if "CYL" in args.custom_loss_config: 122 | cycles_loss = 1 123 | if "SUL" in args.custom_loss_config: 124 | subgraphs_loss = 1 125 | 126 | total_loss = loss 127 | # Add the additional loss terms to the main loss 128 | if "IEL" in args.custom_loss_config: 129 | total_loss += invalid_edges_loss 130 | if "CYL" in args.custom_loss_config: 131 | total_loss += cycles_loss * args.cycles_loss_scaling_factor 132 | if "SUL" in args.custom_loss_config: 133 | total_loss += subgraphs_loss 134 | 135 | 136 | if "IEL" in args.custom_loss_config: 137 | print('Invalid edges loss: ', invalid_edges_loss) 138 | if "CYL" in args.custom_loss_config: 139 | print('Cycles Loss: ', cycles_loss) 140 | if "SUL" in args.custom_loss_config: 141 | print('Subgraphs loss: ', subgraphs_loss) 142 | 143 | print('Total loss: ', total_loss.item()) 144 | 145 | return (total_loss, outputs) if return_outputs else total_loss 146 | 147 | 148 | trainer = CustomTrainer( 149 | model=model, 150 | train_dataset=train_dataset, 151 | peft_config=peft_config, 152 | dataset_text_field="text", 153 | args=training_arguments, 154 | tokenizer=tokenizer, 155 | packing=False, 156 | max_seq_length=4096 157 | ) 158 | 159 | 160 | 161 | get_memory_allocated_cached() 162 | 163 | get_cuda_info() 164 | 165 | device = torch.device("cuda" if torch.cuda.is_available() else "cpu") 166 | print("Device: ", device) 167 | 168 | get_gpu_memory() 169 | 170 | get_nvidia_smi_info(0) 171 | 172 | trainer.train() 173 | 174 | model_path = args.model_for_generation_path 175 | 176 | model_with_peft = peft_merge_unload(model_id, model_path) 177 | 178 | print(model) 179 | 180 | model_with_peft.push_to_hub(args.model_name_hf, access_token) 181 | tokenizer.push_to_hub(args.tokenizer_name_hf, access_token) 182 | 183 | generate_response(user_input=test_dataset['prompt'][0], model=model_with_peft, tokenizer =tokenizer) 184 | 185 | if __name__ == "__main__": 186 | main() 187 | -------------------------------------------------------------------------------- /Model-Notebooks/llama3-notebooks/serve_model.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": null, 6 | "id": "29d8ea94-c6db-4617-a598-7892a2546dc7", 7 | "metadata": {}, 8 | "outputs": [], 9 | "source": [ 10 | "import torch\n", 11 | "from datasets import load_dataset, Dataset\n", 12 | "from peft import LoraConfig, AutoPeftModelForCausalLM\n", 13 | "from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig, TrainingArguments\n", 14 | "from trl import SFTTrainer\n", 15 | "import os\n", 16 | "import re\n", 17 | "import sys" 18 | ] 19 | }, 20 | { 21 | "cell_type": "code", 22 | "execution_count": null, 23 | "id": "cc8bd97c-ec1f-47a3-8491-ab049353e65d", 24 | "metadata": {}, 25 | "outputs": [], 26 | "source": [ 27 | "sys.path.append(os.path.abspath('/path/to/LLM-Reconfiguration/Dataset-Notebooks/utils'))\n", 28 | "\n", 29 | "from dataset_utils import prepare_train_data\n", 30 | "from model_utils import get_model, get_tokenizer\n", 31 | "from generation_utils import *" 32 | ] 33 | }, 34 | { 35 | "cell_type": "code", 36 | "execution_count": null, 37 | "id": "8757257f-43c2-4f4b-a352-23b0a69ae43c", 38 | "metadata": {}, 39 | "outputs": [], 40 | "source": [ 41 | "from huggingface_hub import login\n", 42 | "\n", 43 | "access_token = 'hf_token'\n", 44 | "login(token=access_token)" 45 | ] 46 | }, 47 | { 48 | "cell_type": "code", 49 | "execution_count": null, 50 | "id": "b6954012-6149-4aca-a2ae-cda26d520f50", 51 | "metadata": {}, 52 | "outputs": [], 53 | "source": [ 54 | "data_path=\"/path/to/LLM-Reconfiguration/Dataset-Notebooks/train_files/train_33_69_84_nodes.csv\"\n", 55 | "model_id=\"/path/to/LLM-Reconfiguration/AutoTrain/llama3/model_name/checkpoint-26280\"" 56 | ] 57 | }, 58 | { 59 | "cell_type": "code", 60 | "execution_count": null, 61 | "id": "99db57f3-a3f4-492f-84b3-9ac081008156", 62 | "metadata": {}, 63 | "outputs": [], 64 | "source": [ 65 | "model = get_model(model_id)\n", 66 | "tokenizer = get_tokenizer(model_id)" 67 | ] 68 | }, 69 | { 70 | "cell_type": "code", 71 | "execution_count": null, 72 | "id": "3ef4344e-892a-4c78-b527-d418cdfcd12a", 73 | "metadata": {}, 74 | "outputs": [], 75 | "source": [ 76 | "train_dataset, validation_dataset, test_dataset = prepare_train_data(data_path)" 77 | ] 78 | }, 79 | { 80 | "cell_type": "code", 81 | "execution_count": null, 82 | "id": "9ef65611-4171-4c56-8876-0d205a244198", 83 | "metadata": {}, 84 | "outputs": [], 85 | "source": [ 86 | "peft_config = LoraConfig(\n", 87 | " r=8, lora_alpha=16, lora_dropout=0.05, bias=\"none\", task_type=\"CAUSAL_LM\"\n", 88 | " )" 89 | ] 90 | }, 91 | { 92 | "cell_type": "code", 93 | "execution_count": null, 94 | "id": "7d2f36bd-ecfb-488c-bff2-5d0fc8fb98fb", 95 | "metadata": {}, 96 | "outputs": [], 97 | "source": [ 98 | "model_path =\"/path/to/LLM-Reconfiguration/AutoTrain/llama3/model_name/checkpoint-26280\"\n", 99 | "\n", 100 | "model = peft_merge_unload(model_id, model_path)" 101 | ] 102 | }, 103 | { 104 | "cell_type": "code", 105 | "execution_count": null, 106 | "id": "4ff0f496-bd7b-4fe5-919c-68c16a3ff685", 107 | "metadata": {}, 108 | "outputs": [], 109 | "source": [ 110 | "# Set the model to evaluation mode\n", 111 | "model.eval()" 112 | ] 113 | }, 114 | { 115 | "cell_type": "code", 116 | "execution_count": null, 117 | "id": "3a8530e7-25aa-4b21-979d-aadac4e200f5", 118 | "metadata": {}, 119 | "outputs": [], 120 | "source": [ 121 | "max_tokens = 120000 # Adjust according to your model's capacity" 122 | ] 123 | }, 124 | { 125 | "cell_type": "code", 126 | "execution_count": null, 127 | "id": "fcfb7d7a-0d4f-49f3-8e10-6dfb43eed1a3", 128 | "metadata": {}, 129 | "outputs": [], 130 | "source": [ 131 | "conversation_history = \"\"\n", 132 | "\n", 133 | "# generation_config = GenerationConfig(\n", 134 | "# penalty_alpha=penalty_alpha,\n", 135 | "# do_sample = do_sample,\n", 136 | "# top_k=top_k,\n", 137 | "# temperature=temperature,\n", 138 | "# repetition_penalty=repetition_penalty,\n", 139 | "# max_new_tokens=max_new_tokens,\n", 140 | "# pad_token_id=tokenizer.eos_token_id, \n", 141 | "# eos_token_id=tokenizer.eos_token_id # Ensure EOS token is set - This is a new parameter so maybe it breaks the code.\n", 142 | "# )\n" 143 | ] 144 | }, 145 | { 146 | "cell_type": "code", 147 | "execution_count": null, 148 | "id": "80c5cc51-2bfb-4500-adc8-90d180c235b7", 149 | "metadata": {}, 150 | "outputs": [], 151 | "source": [ 152 | "while True:\n", 153 | " try:\n", 154 | " # Get user input\n", 155 | " user_input = input(\"You: \").strip()\n", 156 | "\n", 157 | " # Check for exit commands before processing further\n", 158 | " if user_input.lower() in ['quit', 'exit']:\n", 159 | " print(\"Exiting the chat.\")\n", 160 | " break # Break out of the loop if user wants to quit\n", 161 | " \n", 162 | " conversation_history += f\"User: {user_input}\\n\"\n", 163 | " \n", 164 | " # Tokenize the conversation history\n", 165 | " input_ids = tokenizer.encode(conversation_history, return_tensors='pt').to('cuda')\n", 166 | " \n", 167 | " # If the number of tokens exceeds the limit, truncate the beginning\n", 168 | " if input_ids.size(-1) > max_tokens:\n", 169 | " input_ids = input_ids[:, -max_tokens:]\n", 170 | " \n", 171 | " # Generate a response\n", 172 | " outputs = model.generate(input_ids, \n", 173 | " max_length=120000, \n", 174 | " max_new_tokens = 1200,\n", 175 | " do_sample=True, \n", 176 | " top_k=5,\n", 177 | " penalty_alpha=0.6,\n", 178 | " temperature=0.5, \n", 179 | " repetition_penalty=1.2,\n", 180 | " pad_token_id=tokenizer.eos_token_id, \n", 181 | " eos_token_id=tokenizer.eos_token_id )\n", 182 | " \n", 183 | " # Decode and print the model's response\n", 184 | " response = tokenizer.decode(outputs[:, input_ids.shape[-1]:][0], skip_special_tokens=True)\n", 185 | " conversation_history += f\"Model: {response}\\n\"\n", 186 | " \n", 187 | " print(f\"Model: {response}\")\n", 188 | "\n", 189 | " except KeyboardInterrupt:\n", 190 | " # Handle manual interruption (Ctrl+C)\n", 191 | " print(\"Chat interrupted manually. Exiting...\")\n", 192 | " break\n" 193 | ] 194 | }, 195 | { 196 | "cell_type": "code", 197 | "execution_count": null, 198 | "id": "77bb4d78-051d-4ec9-903b-fce7e5aa226a", 199 | "metadata": {}, 200 | "outputs": [], 201 | "source": [ 202 | "print(conversation_history)" 203 | ] 204 | }, 205 | { 206 | "cell_type": "code", 207 | "execution_count": null, 208 | "id": "c57275b4-0683-42cd-a18f-bc9ce0f68db3", 209 | "metadata": {}, 210 | "outputs": [], 211 | "source": [ 212 | "test_dataset[0]['prompt']" 213 | ] 214 | }, 215 | { 216 | "cell_type": "code", 217 | "execution_count": null, 218 | "id": "21dc03cf-dfe4-477b-acf0-ac2a42d3c438", 219 | "metadata": {}, 220 | "outputs": [], 221 | "source": [ 222 | "test_dataset[0]['output']" 223 | ] 224 | }, 225 | { 226 | "cell_type": "code", 227 | "execution_count": null, 228 | "id": "7f51c119-368a-46b7-aaf1-915b40924564", 229 | "metadata": {}, 230 | "outputs": [], 231 | "source": [] 232 | }, 233 | { 234 | "cell_type": "code", 235 | "execution_count": null, 236 | "id": "88e5d112-b808-44a3-9227-3fe18f7188fb", 237 | "metadata": {}, 238 | "outputs": [], 239 | "source": [] 240 | } 241 | ], 242 | "metadata": { 243 | "kernelspec": { 244 | "display_name": "my_env", 245 | "language": "python", 246 | "name": "my_env" 247 | }, 248 | "language_info": { 249 | "codemirror_mode": { 250 | "name": "ipython", 251 | "version": 3 252 | }, 253 | "file_extension": ".py", 254 | "mimetype": "text/x-python", 255 | "name": "python", 256 | "nbconvert_exporter": "python", 257 | "pygments_lexer": "ipython3", 258 | "version": "3.12.3" 259 | } 260 | }, 261 | "nbformat": 4, 262 | "nbformat_minor": 5 263 | } 264 | -------------------------------------------------------------------------------- /Dataset-Notebooks/utils/metrics_utils.py: -------------------------------------------------------------------------------- 1 | import torch 2 | import sys 3 | import os 4 | import csv 5 | 6 | sys.path.append(os.path.abspath('/scratch/pc2442/LLM-Reconfiguration/Dataset-Notebooks/utils')) 7 | 8 | from dataset_utils import * 9 | from model_utils import * 10 | from generation_utils import * 11 | 12 | 13 | 14 | def generate_metrics(dataset, response_function, num_samples=10, filename_txt="metrics.txt", filename_csv="metrics.csv"): 15 | """ 16 | Generates responses and then calculates the cycles, invalid edges and the subgraphs 17 | from the predicted lines. The function also keeps track of the inference time. 18 | It returns the avg cycles, invalid edges and subgraphs per response. 19 | 20 | Parameters: 21 | - dataset: The dataset containing the prompts and correct outputs. 22 | - response_function: The function to generate responses. 23 | - num_samples: The number of random samples to generate. 24 | - filename: The name of the file where the responses will be saved. 25 | """ 26 | # Ensure dataset has enough entries 27 | if num_samples > len(dataset): 28 | raise ValueError("The number of samples requested exceeds the dataset size.") 29 | 30 | # Generate random indices 31 | if num_samples == -1: 32 | indices = torch.randint(0, len(dataset), (len(dataset),)) 33 | else: 34 | indices = torch.randint(0, len(dataset), (num_samples,)) 35 | 36 | prep_csv(filename_csv) 37 | 38 | total_cycles_loss = 0 39 | total_invalid_edges_loss = 0 40 | total_subgraphs_loss = 0 41 | no_response_count = 0 42 | total_inference_time = 0 43 | 44 | # Initialize lists to accumulate data 45 | all_num_nodes = [] 46 | all_available_lines = [] 47 | all_generated_open_lines = [] 48 | all_generated_node_voltages = [] 49 | all_system_loss = [] 50 | all_correct_open_lines = [] 51 | all_correct_generated_lines = [] 52 | all_correct_system_loss = [] 53 | 54 | 55 | for index in indices: 56 | # Extract the prompt and correct output using the random index 57 | prompt = dataset['prompt'][index] 58 | correct_output = dataset['output'][index] 59 | 60 | # Generate the response 61 | response, output_time = response_function(user_input=prompt) 62 | total_inference_time += output_time 63 | 64 | reformatted_response = extract_output_data(response) 65 | 66 | 67 | 68 | if reformatted_response != "No output data found in the response.": 69 | 70 | predicted_lines = parse_open_lines(response) 71 | available_lines = parse_available_lines(response) 72 | graph_edges = get_output_graph_edges(predicted_lines, available_lines) 73 | 74 | total_cycles_loss += compute_cycles_loss(graph_edges) 75 | total_invalid_edges_loss += compute_invalid_edges_loss(predicted_lines, available_lines) 76 | total_subgraphs_loss += compute_subgraphs_loss(graph_edges) 77 | 78 | # Extract metrics from the response 79 | num_nodes , generated_open_lines, generated_node_voltages, system_loss = extract_metrics(available_lines, reformatted_response) 80 | 81 | # Parse the correct output for comparison 82 | correct_open_lines, correct_generated_lines, correct_system_loss = parse_correct_output(correct_output) 83 | 84 | # Accumulate the data in lists 85 | all_num_nodes.append(num_nodes) 86 | all_available_lines.append(available_lines) 87 | all_generated_open_lines.append(generated_open_lines) 88 | all_generated_node_voltages.append(generated_node_voltages) 89 | all_system_loss.append(system_loss) 90 | all_correct_open_lines.append(correct_open_lines) 91 | all_correct_generated_lines.append(correct_generated_lines) 92 | all_correct_system_loss.append(correct_system_loss) 93 | 94 | 95 | 96 | else: 97 | no_response_count += 1 98 | 99 | write_to_csv(all_num_nodes, all_available_lines, all_generated_open_lines, all_generated_node_voltages, all_system_loss, all_correct_open_lines, all_correct_generated_lines, all_correct_system_loss, filename_csv) 100 | if num_samples - no_response_count > 0: 101 | avg_cycles_loss = total_cycles_loss / (num_samples - no_response_count) 102 | else: 103 | avg_cycles_loss = 0 104 | # avg_cycles_loss = total_cycles_loss/(num_samples - no_response_count) 105 | avg_invalid_edges_loss = total_invalid_edges_loss/(num_samples - no_response_count) 106 | avg_subgraphs_loss = total_subgraphs_loss/(num_samples - no_response_count) 107 | avg_inference_time = total_inference_time/(num_samples - no_response_count) 108 | 109 | write_to_txt(filename_txt, num_samples, avg_cycles_loss, avg_invalid_edges_loss, avg_subgraphs_loss, no_response_count, avg_inference_time) 110 | 111 | 112 | def extract_metrics(available_lines, reformatted_response): 113 | num_nodes = get_number_of_nodes(available_lines) 114 | generated_open_lines = reformatted_response['Open Lines'] 115 | generated_node_voltages = reformatted_response['Node Voltages'] 116 | system_loss = reformatted_response['System Loss'] 117 | 118 | return num_nodes, generated_open_lines, generated_node_voltages, system_loss 119 | 120 | def parse_correct_output(correct_output): 121 | correct_data = extract_output_data(correct_output) 122 | correct_open_lines = correct_data['Open Lines'] 123 | correct_generated_lines = correct_data['Node Voltages'] 124 | correct_system_loss = correct_data['System Loss'] 125 | 126 | return correct_open_lines, correct_generated_lines, correct_system_loss 127 | 128 | def prep_csv(filename): 129 | # Prepare to write to a CSV file 130 | with open(filename, mode='w', newline='') as file: 131 | writer = csv.writer(file) 132 | # Write the header 133 | writer.writerow([ 134 | "# of nodes", 135 | "available lines", 136 | "generated open lines", 137 | "generated node voltages", 138 | "system loss", 139 | "correct open lines", 140 | "correct generated lines", 141 | "correct system loss" 142 | ]) 143 | 144 | 145 | def write_to_csv(num_nodes, available_lines, generated_open_lines, generated_node_voltages, system_loss, correct_open_lines, correct_generated_lines, correct_system_loss, filename): 146 | # Write the row to the CSV file 147 | with open(filename, mode='a', newline='') as file: 148 | writer = csv.writer(file) 149 | # Write the accumulated rows 150 | writer.writerows(zip( 151 | num_nodes, 152 | available_lines, 153 | generated_open_lines, 154 | generated_node_voltages, 155 | system_loss, 156 | correct_open_lines, 157 | correct_generated_lines, 158 | correct_system_loss 159 | )) 160 | 161 | def write_to_txt(filename, num_samples, avg_cycles_loss, avg_invalid_edges_loss, avg_subgraphs_loss, no_response_count, avg_inference_time): 162 | # Open the file to write the responses 163 | with open(filename, "w") as file: 164 | # Write the prompt, response, and correct output to the file with clear separation 165 | file.write("---- Evaluation Metrics ----\n") 166 | file.write(f"Number of Samples:\n {num_samples}\n") 167 | file.write(f"Average Cycles:\n {avg_cycles_loss}\n") 168 | file.write(f"Average Invalid Edges:\n {avg_invalid_edges_loss}\n") 169 | file.write(f"Average Subgraphs:\n {avg_subgraphs_loss}\n") 170 | file.write(f"Responses with improper output:\n {no_response_count}\n") 171 | file.write(f"Inference Time: {avg_inference_time}\n") 172 | 173 | def get_number_of_nodes(available_lines): 174 | """ 175 | Returns the number of nodes by finding the largest number in the list of tuples. 176 | 177 | Parameters: 178 | - available_lines: A list of tuples representing the available lines. 179 | 180 | Returns: 181 | The largest node number. 182 | """ 183 | # Flatten the list of tuples to a single list of integers 184 | nodes = [node for line in available_lines for node in line] 185 | 186 | # Return the largest number 187 | return max(nodes) if nodes else 0 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /Dataset-Notebooks/dataset_creation_script.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "metadata": { 6 | "id": "aaVlTzzMndFg" 7 | }, 8 | "source": [ 9 | "Import the CSV file containing all of the entries as a data frame to inspect it." 10 | ] 11 | }, 12 | { 13 | "cell_type": "code", 14 | "execution_count": null, 15 | "metadata": {}, 16 | "outputs": [], 17 | "source": [ 18 | "import os\n", 19 | "import pandas as pd\n", 20 | "import pickle\n", 21 | "import numpy as np" 22 | ] 23 | }, 24 | { 25 | "cell_type": "code", 26 | "execution_count": null, 27 | "metadata": {}, 28 | "outputs": [], 29 | "source": [ 30 | "sys.path.append(os.path.abspath('/path/to/LLM-Reconfiguration/Dataset-Notebooks/utils'))\n", 31 | "from dataset_utils import *" 32 | ] 33 | }, 34 | { 35 | "cell_type": "code", 36 | "execution_count": null, 37 | "metadata": { 38 | "colab": { 39 | "base_uri": "https://localhost:8080/" 40 | }, 41 | "executionInfo": { 42 | "elapsed": 9019, 43 | "status": "ok", 44 | "timestamp": 1716991072768, 45 | "user": { 46 | "displayName": "Panayiotis Christou", 47 | "userId": "08170992695377941087" 48 | }, 49 | "user_tz": 240 50 | }, 51 | "id": "MR7McR_Kmzxc", 52 | "outputId": "13e3dc82-efd1-4ca1-857e-93bbc084b6db" 53 | }, 54 | "outputs": [], 55 | "source": [ 56 | "# Load the CSV file\n", 57 | "file_path = '/path/to/LLM-Reconfiguration/Dataset-Notebooks/csv_files/samples_136bus.csv' # Replace with your file path\n", 58 | "data = pd.read_csv(file_path)\n", 59 | "\n", 60 | "# Display the first few rows of the dataframe\n", 61 | "print(data.head())" 62 | ] 63 | }, 64 | { 65 | "cell_type": "markdown", 66 | "metadata": { 67 | "id": "X0-WFkXmneAO" 68 | }, 69 | "source": [ 70 | "Create a dictionary the iterates over every column of the data frame and creates a list of dictionaries where each dictionary has keys of each column of the data frame and it's corresponding values." 71 | ] 72 | }, 73 | { 74 | "cell_type": "code", 75 | "execution_count": null, 76 | "metadata": { 77 | "colab": { 78 | "base_uri": "https://localhost:8080/" 79 | }, 80 | "executionInfo": { 81 | "elapsed": 86206, 82 | "status": "ok", 83 | "timestamp": 1716991158972, 84 | "user": { 85 | "displayName": "Panayiotis Christou", 86 | "userId": "08170992695377941087" 87 | }, 88 | "user_tz": 240 89 | }, 90 | "id": "i160KDKrnARa", 91 | "outputId": "6d638d10-4e7d-488c-9c3b-d04b07d1fd46" 92 | }, 93 | "outputs": [], 94 | "source": [ 95 | "data_dict_list = convert_to_dict(data)\n", 96 | "\n", 97 | "# Display the first few dictionaries\n", 98 | "# for entry in data_dict_list[:1]:\n", 99 | "# print(entry)" 100 | ] 101 | }, 102 | { 103 | "cell_type": "markdown", 104 | "metadata": { 105 | "id": "gE5j5nHgnkL7" 106 | }, 107 | "source": [ 108 | "Save the dictionary in a pickle (pkl) file so that we can load and process it faster and more easily and natievely in python. Avoided JSON due to serialization issues of complex numbers.\n", 109 | "\n", 110 | "The reason we first have a pickle file and then we create the dataset in a text file even though we will be using purely text prompts is to preserve the number data format in one of the files in case we want to calculate any power laws in the future." 111 | ] 112 | }, 113 | { 114 | "cell_type": "code", 115 | "execution_count": null, 116 | "metadata": { 117 | "colab": { 118 | "base_uri": "https://localhost:8080/" 119 | }, 120 | "executionInfo": { 121 | "elapsed": 8145, 122 | "status": "ok", 123 | "timestamp": 1716991167113, 124 | "user": { 125 | "displayName": "Panayiotis Christou", 126 | "userId": "08170992695377941087" 127 | }, 128 | "user_tz": 240 129 | }, 130 | "id": "15rHQtwKnA5-", 131 | "outputId": "2e8a5d60-936d-4327-d26b-ed68a74fe046" 132 | }, 133 | "outputs": [], 134 | "source": [ 135 | "# Save the list of dictionaries to a Pickle file\n", 136 | "output_file_path = '/path/to/LLM-Reconfiguration/Dataset-Notebooks/pkl_files/samples_136bus.pkl'\n", 137 | "dict_to_pickle(data_dict_list, output_file_path)\n" 138 | ] 139 | }, 140 | { 141 | "cell_type": "markdown", 142 | "metadata": { 143 | "id": "o61A_G4hnl6X" 144 | }, 145 | "source": [ 146 | "We then iterate through each dictionary in the list and create a text prompt as structured as graph, connectivity, task description, input statistics using the various keys in the dictionary. We then save the file so we don't have to keep creating the pickle and text file every time we want to fine-tune the model." 147 | ] 148 | }, 149 | { 150 | "cell_type": "code", 151 | "execution_count": null, 152 | "metadata": { 153 | "colab": { 154 | "base_uri": "https://localhost:8080/" 155 | }, 156 | "executionInfo": { 157 | "elapsed": 12034, 158 | "status": "ok", 159 | "timestamp": 1716991179144, 160 | "user": { 161 | "displayName": "Panayiotis Christou", 162 | "userId": "08170992695377941087" 163 | }, 164 | "user_tz": 240 165 | }, 166 | "id": "itSD0JehnGEX", 167 | "outputId": "90237bc5-cfdf-484c-d595-ccc06a2e78ae" 168 | }, 169 | "outputs": [], 170 | "source": [ 171 | "# Load the dataset\n", 172 | "file_path = '/path/to/LLM-Reconfiguration/Dataset-Notebooks/pkl_files/samples_136bus.pkl'\n", 173 | "\n", 174 | "data = load_pickle(file_path)\n", 175 | "\n", 176 | "# Display the structure of the dataset\n", 177 | "print(type(data))\n", 178 | "print(len(data))\n", 179 | "print(data[0]) # Display the first entry for inspection\n", 180 | " \n", 181 | "task_description = \"\"\" \n", 182 | "Find the optimal configuration, i.e. the optimal connectivity and optimal open lines of these buses and lines \n", 183 | "so as to ensure energy distribution to the whole system while minimizing the power loss. The number given for the busses indicates the \n", 184 | "total number of busses starting from 1 going all the way to the given number in increments of 1. Make sure the Open Lines \n", 185 | "in the output include ONLY Lines that are given in the input and that you take into account their given properties. \n", 186 | "The Available Lines WITHOUT the Open Lines should form a network graph that is a single graph, i.e. no subgraphs or \n", 187 | "multiple connected components lists and the graph should NOT contain any cycles i.e. the number of available lines WITHOUT \n", 188 | "the number of open lines should EQUAL the number of busses minus one. If you predict the system loss and the value is greater \n", 189 | "than the current system loss, DO NOT reconfigure the network and return the same configuration as in the input. ONLY \n", 190 | "return a reconfiguration if and only if the system loss you predict is less than the original one since that is the ultimate goal.\n", 191 | "The output format should be strictly as follows Output: Open Lines=[List all predicted open lines as a list of tuples, i.e. pairs in \n", 192 | "brackets separated by a comma], Node Voltages=[List the updated node voltages as a comma separated list], System Loss=predicted system loss.\n", 193 | "Do not output anything that is not of this exact format. Stop the output the moment you finish with the system loss, i.e. after you give the \n", 194 | "system loss to 3-4 decimal points print an eos token and stop generating more output. Adhere to the format 100%.\n", 195 | "\"\"\"\n", 196 | " \n", 197 | "# Generate inputs\n", 198 | "inputs = create_inputs(data)\n", 199 | "\n", 200 | "# Generate outputs\n", 201 | "outputs = create_outputs(data)\n", 202 | "\n", 203 | "# Display the first input as a sample\n", 204 | "print(len(inputs))\n", 205 | "\n", 206 | "# Display the first output as a sample\n", 207 | "print(len(outputs))\n", 208 | "\n", 209 | "input_path = '/path/to/LLM-Reconfiguration/Dataset-Notebooks/txt_files/inputs.txt'\n", 210 | "# Save the inputs to a text file\n", 211 | "save_to_txt(input_path, inputs)\n", 212 | " \n", 213 | "output_path = '/path/to/LLM-Reconfiguration/Dataset-Notebooks/txt_files/outputs.txt'\n", 214 | "# Save the outputs to a text file\n", 215 | "save_to_txt(output_path, outputs)" 216 | ] 217 | }, 218 | { 219 | "cell_type": "markdown", 220 | "metadata": { 221 | "id": "-TWerAeCnsf3" 222 | }, 223 | "source": [ 224 | "We create a function to load prompts as a list so we can iterate through each prompt in the list during training." 225 | ] 226 | }, 227 | { 228 | "cell_type": "code", 229 | "execution_count": null, 230 | "metadata": { 231 | "colab": { 232 | "base_uri": "https://localhost:8080/" 233 | }, 234 | "executionInfo": { 235 | "elapsed": 372, 236 | "status": "ok", 237 | "timestamp": 1716991179506, 238 | "user": { 239 | "displayName": "Panayiotis Christou", 240 | "userId": "08170992695377941087" 241 | }, 242 | "user_tz": 240 243 | }, 244 | "id": "f9MOMrvwnMG6", 245 | "outputId": "a78b5193-04fe-4469-ea72-d3958ce70290" 246 | }, 247 | "outputs": [], 248 | "source": [ 249 | "# Load the inputs\n", 250 | "inputs = load_entries('/path/to/LLM-Reconfiguration/Dataset-Notebooks/txt_files/inputs.txt')\n", 251 | "\n", 252 | "# Load the outputs\n", 253 | "outputs = load_entries('/path/to/LLM-Reconfiguration/Dataset-Notebooks/txt_files/outputs.txt')\n", 254 | "\n", 255 | "# Display the first input as a sample\n", 256 | "print(inputs[0])\n", 257 | "\n", 258 | "# Display the first output as a sample\n", 259 | "print(outputs[0])" 260 | ] 261 | }, 262 | { 263 | "cell_type": "code", 264 | "execution_count": null, 265 | "metadata": { 266 | "colab": { 267 | "base_uri": "https://localhost:8080/" 268 | }, 269 | "executionInfo": { 270 | "elapsed": 3, 271 | "status": "ok", 272 | "timestamp": 1716991179506, 273 | "user": { 274 | "displayName": "Panayiotis Christou", 275 | "userId": "08170992695377941087" 276 | }, 277 | "user_tz": 240 278 | }, 279 | "id": "tKs6nK2unzwm", 280 | "outputId": "add85e46-6bee-445c-8b5c-0c57b004009f" 281 | }, 282 | "outputs": [], 283 | "source": [ 284 | "print(len(inputs[0]))\n", 285 | "print(len(outputs[0]))" 286 | ] 287 | }, 288 | { 289 | "cell_type": "code", 290 | "execution_count": null, 291 | "metadata": {}, 292 | "outputs": [], 293 | "source": [ 294 | "print(len(inputs))\n", 295 | "print(len(outputs))" 296 | ] 297 | }, 298 | { 299 | "cell_type": "code", 300 | "execution_count": null, 301 | "metadata": {}, 302 | "outputs": [], 303 | "source": [ 304 | "task_descriptions = create_task_descriptions(task_description, inputs)\n", 305 | "print(len(task_descriptions))" 306 | ] 307 | }, 308 | { 309 | "cell_type": "code", 310 | "execution_count": null, 311 | "metadata": {}, 312 | "outputs": [], 313 | "source": [ 314 | "print(task_description)" 315 | ] 316 | }, 317 | { 318 | "cell_type": "code", 319 | "execution_count": null, 320 | "metadata": {}, 321 | "outputs": [], 322 | "source": [ 323 | "prompts = create_prompts(task_descriptions, inputs)\n", 324 | "print(len(prompts))" 325 | ] 326 | }, 327 | { 328 | "cell_type": "code", 329 | "execution_count": null, 330 | "metadata": {}, 331 | "outputs": [], 332 | "source": [ 333 | "print(prompts[0])" 334 | ] 335 | }, 336 | { 337 | "cell_type": "code", 338 | "execution_count": null, 339 | "metadata": {}, 340 | "outputs": [], 341 | "source": [ 342 | "train_df = create_train_df(task_descriptions, inputs, prompts, outputs)" 343 | ] 344 | }, 345 | { 346 | "cell_type": "code", 347 | "execution_count": null, 348 | "metadata": { 349 | "id": "K2-UFVfLnUjP" 350 | }, 351 | "outputs": [], 352 | "source": [ 353 | "generate_random_split(train_df)" 354 | ] 355 | }, 356 | { 357 | "cell_type": "code", 358 | "execution_count": null, 359 | "metadata": {}, 360 | "outputs": [], 361 | "source": [ 362 | "train_df.head(5)" 363 | ] 364 | }, 365 | { 366 | "cell_type": "code", 367 | "execution_count": null, 368 | "metadata": {}, 369 | "outputs": [], 370 | "source": [ 371 | "train_df.to_csv('/path/to/LLM-Reconfiguration/Dataset-Notebooks/train_files/train_136_nodes.csv',index_label = 'id')" 372 | ] 373 | }, 374 | { 375 | "cell_type": "code", 376 | "execution_count": null, 377 | "metadata": {}, 378 | "outputs": [], 379 | "source": [ 380 | "#Used to modify columns of the dataset\n", 381 | "\n", 382 | "# file_path = '/path/to/LLM-Reconfiguration/Dataset-Notebooks/samples_69bus.csv'\n", 383 | "# set_value = '69'\n", 384 | "# df_column = 'buses'\n", 385 | "# output_file_path = '/path/to/LLM-Reconfiguration/Dataset-Notebooks/samples_69bus_clean.csv'\n", 386 | "\n", 387 | "\n", 388 | "# modify_and_save(file_path, set_value, df_column, output_file_path)" 389 | ] 390 | }, 391 | { 392 | "cell_type": "code", 393 | "execution_count": null, 394 | "metadata": {}, 395 | "outputs": [], 396 | "source": [ 397 | "file_paths = [\n", 398 | " '/path/to//LLM-Reconfiguration/Dataset-Notebooks/train_files/train_33_nodes.csv',\n", 399 | " '/path/to/LLM-Reconfiguration/Dataset-Notebooks/train_files/train_69_nodes.csv',\n", 400 | " '/path/to/LLM-Reconfiguration/Dataset-Notebooks/train_files/train_84_nodes.csv',\n", 401 | "]\n", 402 | "\n", 403 | "output_file_path = '/path/to/LLM-Reconfiguration/Dataset-Notebooks/train_files/train_33_69_84_nodes.csv'\n", 404 | "\n", 405 | "combine_csv_files(file_paths, output_file_path)" 406 | ] 407 | }, 408 | { 409 | "cell_type": "code", 410 | "execution_count": null, 411 | "metadata": {}, 412 | "outputs": [], 413 | "source": [ 414 | "# Get lengths of prompts and outputs\n", 415 | "\n", 416 | "file_path = '/path/to//LLM-Reconfiguration/Dataset-Notebooks/train_84_nodes.csv' # Replace with your file path\n", 417 | "data = pd.read_csv(file_path)\n", 418 | "\n", 419 | "print(len(prompts[0]))\n", 420 | "print(len(outputs[0]))" 421 | ] 422 | }, 423 | { 424 | "cell_type": "code", 425 | "execution_count": null, 426 | "metadata": {}, 427 | "outputs": [], 428 | "source": [] 429 | } 430 | ], 431 | "metadata": { 432 | "accelerator": "GPU", 433 | "colab": { 434 | "authorship_tag": "ABX9TyNCbx5+epBMio+sh8WOd0FX", 435 | "gpuType": "L4", 436 | "machine_shape": "hm", 437 | "provenance": [] 438 | }, 439 | "kernelspec": { 440 | "display_name": "my_env", 441 | "language": "python", 442 | "name": "my_env" 443 | }, 444 | "language_info": { 445 | "codemirror_mode": { 446 | "name": "ipython", 447 | "version": 3 448 | }, 449 | "file_extension": ".py", 450 | "mimetype": "text/x-python", 451 | "name": "python", 452 | "nbconvert_exporter": "python", 453 | "pygments_lexer": "ipython3", 454 | "version": "3.12.3" 455 | }, 456 | "widgets": { 457 | "application/vnd.jupyter.widget-state+json": { 458 | "0000cec1bb664cc5920137780b80a111": { 459 | "model_module": "@jupyter-widgets/controls", 460 | "model_module_version": "1.5.0", 461 | "model_name": "HTMLModel", 462 | "state": { 463 | "_dom_classes": [], 464 | "_model_module": "@jupyter-widgets/controls", 465 | "_model_module_version": "1.5.0", 466 | "_model_name": "HTMLModel", 467 | "_view_count": null, 468 | "_view_module": "@jupyter-widgets/controls", 469 | "_view_module_version": "1.5.0", 470 | "_view_name": "HTMLView", 471 | "description": "", 472 | "description_tooltip": null, 473 | "layout": "IPY_MODEL_589c2eaf6c0044ad845f6e9e53f3a477", 474 | "placeholder": "​", 475 | "style": "IPY_MODEL_aaf1ac823aac489ca591ff0cc635423f", 476 | "value": "generation_config.json: 100%" 477 | } 478 | }, 479 | "0ba53fc0dc264a6eb1b531164c563779": { 480 | "model_module": "@jupyter-widgets/controls", 481 | "model_module_version": "1.5.0", 482 | "model_name": "HTMLModel", 483 | "state": { 484 | "_dom_classes": [], 485 | "_model_module": "@jupyter-widgets/controls", 486 | "_model_module_version": "1.5.0", 487 | "_model_name": "HTMLModel", 488 | "_view_count": null, 489 | "_view_module": "@jupyter-widgets/controls", 490 | "_view_module_version": "1.5.0", 491 | "_view_name": "HTMLView", 492 | "description": "", 493 | "description_tooltip": null, 494 | "layout": "IPY_MODEL_f463bbf22a8d48528a56870357d05d1c", 495 | "placeholder": "​", 496 | "style": "IPY_MODEL_762b99c3ade9437dabec35e64f0a0e62", 497 | "value": " 26.0/26.0 [00:00<00:00, 1.79kB/s]" 498 | } 499 | }, 500 | "0ce52871be5b4bd1bddcbd7cbaebd008": { 501 | "model_module": "@jupyter-widgets/controls", 502 | "model_module_version": "1.5.0", 503 | "model_name": "HTMLModel", 504 | "state": { 505 | "_dom_classes": [], 506 | "_model_module": "@jupyter-widgets/controls", 507 | "_model_module_version": "1.5.0", 508 | "_model_name": "HTMLModel", 509 | "_view_count": null, 510 | "_view_module": "@jupyter-widgets/controls", 511 | "_view_module_version": "1.5.0", 512 | "_view_name": "HTMLView", 513 | "description": "", 514 | "description_tooltip": null, 515 | "layout": "IPY_MODEL_edaf92da62ab445d93d628f8f3fa659d", 516 | "placeholder": "​", 517 | "style": "IPY_MODEL_77835887a1334e35a53cd2fdba258456", 518 | "value": "vocab.json: 100%" 519 | } 520 | }, 521 | "0de561e59edb4cb4b1ee857c7c4de79c": { 522 | "model_module": "@jupyter-widgets/controls", 523 | "model_module_version": "1.5.0", 524 | "model_name": "HBoxModel", 525 | "state": { 526 | "_dom_classes": [], 527 | "_model_module": "@jupyter-widgets/controls", 528 | "_model_module_version": "1.5.0", 529 | "_model_name": "HBoxModel", 530 | "_view_count": null, 531 | "_view_module": "@jupyter-widgets/controls", 532 | "_view_module_version": "1.5.0", 533 | "_view_name": "HBoxView", 534 | "box_style": "", 535 | "children": [ 536 | "IPY_MODEL_ad1b8147bcfa43e5b7a8754f4729d207", 537 | "IPY_MODEL_ac63aa65d1834a9c975b4aee7226b7a3", 538 | "IPY_MODEL_72fe31effb6e456da776668b9661f081" 539 | ], 540 | "layout": "IPY_MODEL_8f2cfeecc96340fda657b5e51feca4af" 541 | } 542 | }, 543 | "0e430d32d3a743a5831d993ee23488c5": { 544 | "model_module": "@jupyter-widgets/base", 545 | "model_module_version": "1.2.0", 546 | "model_name": "LayoutModel", 547 | "state": { 548 | "_model_module": "@jupyter-widgets/base", 549 | "_model_module_version": "1.2.0", 550 | "_model_name": "LayoutModel", 551 | "_view_count": null, 552 | "_view_module": "@jupyter-widgets/base", 553 | "_view_module_version": "1.2.0", 554 | "_view_name": "LayoutView", 555 | "align_content": null, 556 | "align_items": null, 557 | "align_self": null, 558 | "border": null, 559 | "bottom": null, 560 | "display": null, 561 | "flex": null, 562 | "flex_flow": null, 563 | "grid_area": null, 564 | "grid_auto_columns": null, 565 | "grid_auto_flow": null, 566 | "grid_auto_rows": null, 567 | "grid_column": null, 568 | "grid_gap": null, 569 | "grid_row": null, 570 | "grid_template_areas": null, 571 | "grid_template_columns": null, 572 | "grid_template_rows": null, 573 | "height": null, 574 | "justify_content": null, 575 | "justify_items": null, 576 | "left": null, 577 | "margin": null, 578 | "max_height": null, 579 | "max_width": null, 580 | "min_height": null, 581 | "min_width": null, 582 | "object_fit": null, 583 | "object_position": null, 584 | "order": null, 585 | "overflow": null, 586 | "overflow_x": null, 587 | "overflow_y": null, 588 | "padding": null, 589 | "right": null, 590 | "top": null, 591 | "visibility": null, 592 | "width": null 593 | } 594 | }, 595 | "18eb7e8cce3b40dcb0c3b2f1d6f07bed": { 596 | "model_module": "@jupyter-widgets/controls", 597 | "model_module_version": "1.5.0", 598 | "model_name": "ProgressStyleModel", 599 | "state": { 600 | "_model_module": "@jupyter-widgets/controls", 601 | "_model_module_version": "1.5.0", 602 | "_model_name": "ProgressStyleModel", 603 | "_view_count": null, 604 | "_view_module": "@jupyter-widgets/base", 605 | "_view_module_version": "1.2.0", 606 | "_view_name": "StyleView", 607 | "bar_color": null, 608 | "description_width": "" 609 | } 610 | }, 611 | "1a7b70b040ed444b9a5090f5d1f50297": { 612 | "model_module": "@jupyter-widgets/controls", 613 | "model_module_version": "1.5.0", 614 | "model_name": "HTMLModel", 615 | "state": { 616 | "_dom_classes": [], 617 | "_model_module": "@jupyter-widgets/controls", 618 | "_model_module_version": "1.5.0", 619 | "_model_name": "HTMLModel", 620 | "_view_count": null, 621 | "_view_module": "@jupyter-widgets/controls", 622 | "_view_module_version": "1.5.0", 623 | "_view_name": "HTMLView", 624 | "description": "", 625 | "description_tooltip": null, 626 | "layout": "IPY_MODEL_25c2f5758ee9426c85aa6de12cb8bfe1", 627 | "placeholder": "​", 628 | "style": "IPY_MODEL_25b012c70db74322817f0f1996dd3ab8", 629 | "value": "tokenizer_config.json: 100%" 630 | } 631 | }, 632 | "1b46e582c8224a72b8c8a5c249cd1e50": { 633 | "model_module": "@jupyter-widgets/controls", 634 | "model_module_version": "1.5.0", 635 | "model_name": "ProgressStyleModel", 636 | "state": { 637 | "_model_module": "@jupyter-widgets/controls", 638 | "_model_module_version": "1.5.0", 639 | "_model_name": "ProgressStyleModel", 640 | "_view_count": null, 641 | "_view_module": "@jupyter-widgets/base", 642 | "_view_module_version": "1.2.0", 643 | "_view_name": "StyleView", 644 | "bar_color": null, 645 | "description_width": "" 646 | } 647 | }, 648 | "2144b7805b7e4c9c90f41405ebcb2c4b": { 649 | "model_module": "@jupyter-widgets/base", 650 | "model_module_version": "1.2.0", 651 | "model_name": "LayoutModel", 652 | "state": { 653 | "_model_module": "@jupyter-widgets/base", 654 | "_model_module_version": "1.2.0", 655 | "_model_name": "LayoutModel", 656 | "_view_count": null, 657 | "_view_module": "@jupyter-widgets/base", 658 | "_view_module_version": "1.2.0", 659 | "_view_name": "LayoutView", 660 | "align_content": null, 661 | "align_items": null, 662 | "align_self": null, 663 | "border": null, 664 | "bottom": null, 665 | "display": null, 666 | "flex": null, 667 | "flex_flow": null, 668 | "grid_area": null, 669 | "grid_auto_columns": null, 670 | "grid_auto_flow": null, 671 | "grid_auto_rows": null, 672 | "grid_column": null, 673 | "grid_gap": null, 674 | "grid_row": null, 675 | "grid_template_areas": null, 676 | "grid_template_columns": null, 677 | "grid_template_rows": null, 678 | "height": null, 679 | "justify_content": null, 680 | "justify_items": null, 681 | "left": null, 682 | "margin": null, 683 | "max_height": null, 684 | "max_width": null, 685 | "min_height": null, 686 | "min_width": null, 687 | "object_fit": null, 688 | "object_position": null, 689 | "order": null, 690 | "overflow": null, 691 | "overflow_x": null, 692 | "overflow_y": null, 693 | "padding": null, 694 | "right": null, 695 | "top": null, 696 | "visibility": null, 697 | "width": null 698 | } 699 | }, 700 | "25b012c70db74322817f0f1996dd3ab8": { 701 | "model_module": "@jupyter-widgets/controls", 702 | "model_module_version": "1.5.0", 703 | "model_name": "DescriptionStyleModel", 704 | "state": { 705 | "_model_module": "@jupyter-widgets/controls", 706 | "_model_module_version": "1.5.0", 707 | "_model_name": "DescriptionStyleModel", 708 | "_view_count": null, 709 | "_view_module": "@jupyter-widgets/base", 710 | "_view_module_version": "1.2.0", 711 | "_view_name": "StyleView", 712 | "description_width": "" 713 | } 714 | }, 715 | "25c2f5758ee9426c85aa6de12cb8bfe1": { 716 | "model_module": "@jupyter-widgets/base", 717 | "model_module_version": "1.2.0", 718 | "model_name": "LayoutModel", 719 | "state": { 720 | "_model_module": "@jupyter-widgets/base", 721 | "_model_module_version": "1.2.0", 722 | "_model_name": "LayoutModel", 723 | "_view_count": null, 724 | "_view_module": "@jupyter-widgets/base", 725 | "_view_module_version": "1.2.0", 726 | "_view_name": "LayoutView", 727 | "align_content": null, 728 | "align_items": null, 729 | "align_self": null, 730 | "border": null, 731 | "bottom": null, 732 | "display": null, 733 | "flex": null, 734 | "flex_flow": null, 735 | "grid_area": null, 736 | "grid_auto_columns": null, 737 | "grid_auto_flow": null, 738 | "grid_auto_rows": null, 739 | "grid_column": null, 740 | "grid_gap": null, 741 | "grid_row": null, 742 | "grid_template_areas": null, 743 | "grid_template_columns": null, 744 | "grid_template_rows": null, 745 | "height": null, 746 | "justify_content": null, 747 | "justify_items": null, 748 | "left": null, 749 | "margin": null, 750 | "max_height": null, 751 | "max_width": null, 752 | "min_height": null, 753 | "min_width": null, 754 | "object_fit": null, 755 | "object_position": null, 756 | "order": null, 757 | "overflow": null, 758 | "overflow_x": null, 759 | "overflow_y": null, 760 | "padding": null, 761 | "right": null, 762 | "top": null, 763 | "visibility": null, 764 | "width": null 765 | } 766 | }, 767 | "2a27dc7041dc46da8d7a29de5c86c7e5": { 768 | "model_module": "@jupyter-widgets/controls", 769 | "model_module_version": "1.5.0", 770 | "model_name": "HTMLModel", 771 | "state": { 772 | "_dom_classes": [], 773 | "_model_module": "@jupyter-widgets/controls", 774 | "_model_module_version": "1.5.0", 775 | "_model_name": "HTMLModel", 776 | "_view_count": null, 777 | "_view_module": "@jupyter-widgets/controls", 778 | "_view_module_version": "1.5.0", 779 | "_view_name": "HTMLView", 780 | "description": "", 781 | "description_tooltip": null, 782 | "layout": "IPY_MODEL_bfb59061e8fa4460a321253800257721", 783 | "placeholder": "​", 784 | "style": "IPY_MODEL_6df619f4469d4742aae74bd72cbe84c1", 785 | "value": " 548M/548M [00:01<00:00, 414MB/s]" 786 | } 787 | }, 788 | "3032d78ba7914c61b314babf08b0063e": { 789 | "model_module": "@jupyter-widgets/base", 790 | "model_module_version": "1.2.0", 791 | "model_name": "LayoutModel", 792 | "state": { 793 | "_model_module": "@jupyter-widgets/base", 794 | "_model_module_version": "1.2.0", 795 | "_model_name": "LayoutModel", 796 | "_view_count": null, 797 | "_view_module": "@jupyter-widgets/base", 798 | "_view_module_version": "1.2.0", 799 | "_view_name": "LayoutView", 800 | "align_content": null, 801 | "align_items": null, 802 | "align_self": null, 803 | "border": null, 804 | "bottom": null, 805 | "display": null, 806 | "flex": null, 807 | "flex_flow": null, 808 | "grid_area": null, 809 | "grid_auto_columns": null, 810 | "grid_auto_flow": null, 811 | "grid_auto_rows": null, 812 | "grid_column": null, 813 | "grid_gap": null, 814 | "grid_row": null, 815 | "grid_template_areas": null, 816 | "grid_template_columns": null, 817 | "grid_template_rows": null, 818 | "height": null, 819 | "justify_content": null, 820 | "justify_items": null, 821 | "left": null, 822 | "margin": null, 823 | "max_height": null, 824 | "max_width": null, 825 | "min_height": null, 826 | "min_width": null, 827 | "object_fit": null, 828 | "object_position": null, 829 | "order": null, 830 | "overflow": null, 831 | "overflow_x": null, 832 | "overflow_y": null, 833 | "padding": null, 834 | "right": null, 835 | "top": null, 836 | "visibility": null, 837 | "width": null 838 | } 839 | }, 840 | "30f7666533ca4a67b4690640655338d8": { 841 | "model_module": "@jupyter-widgets/controls", 842 | "model_module_version": "1.5.0", 843 | "model_name": "ProgressStyleModel", 844 | "state": { 845 | "_model_module": "@jupyter-widgets/controls", 846 | "_model_module_version": "1.5.0", 847 | "_model_name": "ProgressStyleModel", 848 | "_view_count": null, 849 | "_view_module": "@jupyter-widgets/base", 850 | "_view_module_version": "1.2.0", 851 | "_view_name": "StyleView", 852 | "bar_color": null, 853 | "description_width": "" 854 | } 855 | }, 856 | "31a6e30fda2b46dca7f97151cd7f9a66": { 857 | "model_module": "@jupyter-widgets/controls", 858 | "model_module_version": "1.5.0", 859 | "model_name": "FloatProgressModel", 860 | "state": { 861 | "_dom_classes": [], 862 | "_model_module": "@jupyter-widgets/controls", 863 | "_model_module_version": "1.5.0", 864 | "_model_name": "FloatProgressModel", 865 | "_view_count": null, 866 | "_view_module": "@jupyter-widgets/controls", 867 | "_view_module_version": "1.5.0", 868 | "_view_name": "ProgressView", 869 | "bar_style": "success", 870 | "description": "", 871 | "description_tooltip": null, 872 | "layout": "IPY_MODEL_5bc4e02a6d114b3a97a043a141f765b4", 873 | "max": 456318, 874 | "min": 0, 875 | "orientation": "horizontal", 876 | "style": "IPY_MODEL_cdd149cb7f374c7882336633490652a8", 877 | "value": 456318 878 | } 879 | }, 880 | "3632c68c7ae449c28925e1b075d768e1": { 881 | "model_module": "@jupyter-widgets/controls", 882 | "model_module_version": "1.5.0", 883 | "model_name": "HBoxModel", 884 | "state": { 885 | "_dom_classes": [], 886 | "_model_module": "@jupyter-widgets/controls", 887 | "_model_module_version": "1.5.0", 888 | "_model_name": "HBoxModel", 889 | "_view_count": null, 890 | "_view_module": "@jupyter-widgets/controls", 891 | "_view_module_version": "1.5.0", 892 | "_view_name": "HBoxView", 893 | "box_style": "", 894 | "children": [ 895 | "IPY_MODEL_0000cec1bb664cc5920137780b80a111", 896 | "IPY_MODEL_6349d308618c43beaf55d6e1f10ae188", 897 | "IPY_MODEL_5a005a1510c74e08bc0af1c59e180c7d" 898 | ], 899 | "layout": "IPY_MODEL_ec9f2566def44a21adc910def93c5714" 900 | } 901 | }, 902 | "3788698b38554d248d1516d911118b4d": { 903 | "model_module": "@jupyter-widgets/controls", 904 | "model_module_version": "1.5.0", 905 | "model_name": "DescriptionStyleModel", 906 | "state": { 907 | "_model_module": "@jupyter-widgets/controls", 908 | "_model_module_version": "1.5.0", 909 | "_model_name": "DescriptionStyleModel", 910 | "_view_count": null, 911 | "_view_module": "@jupyter-widgets/base", 912 | "_view_module_version": "1.2.0", 913 | "_view_name": "StyleView", 914 | "description_width": "" 915 | } 916 | }, 917 | "3b2f1207b949406b8b71839fc13c4fdf": { 918 | "model_module": "@jupyter-widgets/controls", 919 | "model_module_version": "1.5.0", 920 | "model_name": "DescriptionStyleModel", 921 | "state": { 922 | "_model_module": "@jupyter-widgets/controls", 923 | "_model_module_version": "1.5.0", 924 | "_model_name": "DescriptionStyleModel", 925 | "_view_count": null, 926 | "_view_module": "@jupyter-widgets/base", 927 | "_view_module_version": "1.2.0", 928 | "_view_name": "StyleView", 929 | "description_width": "" 930 | } 931 | }, 932 | "42ebaa64ad7a453fb7fef43137411210": { 933 | "model_module": "@jupyter-widgets/controls", 934 | "model_module_version": "1.5.0", 935 | "model_name": "FloatProgressModel", 936 | "state": { 937 | "_dom_classes": [], 938 | "_model_module": "@jupyter-widgets/controls", 939 | "_model_module_version": "1.5.0", 940 | "_model_name": "FloatProgressModel", 941 | "_view_count": null, 942 | "_view_module": "@jupyter-widgets/controls", 943 | "_view_module_version": "1.5.0", 944 | "_view_name": "ProgressView", 945 | "bar_style": "success", 946 | "description": "", 947 | "description_tooltip": null, 948 | "layout": "IPY_MODEL_ae2d4a6b262c4228824d21c660919068", 949 | "max": 26, 950 | "min": 0, 951 | "orientation": "horizontal", 952 | "style": "IPY_MODEL_1b46e582c8224a72b8c8a5c249cd1e50", 953 | "value": 26 954 | } 955 | }, 956 | "452ee4a6a62346fe91f66cb00f619cee": { 957 | "model_module": "@jupyter-widgets/controls", 958 | "model_module_version": "1.5.0", 959 | "model_name": "ProgressStyleModel", 960 | "state": { 961 | "_model_module": "@jupyter-widgets/controls", 962 | "_model_module_version": "1.5.0", 963 | "_model_name": "ProgressStyleModel", 964 | "_view_count": null, 965 | "_view_module": "@jupyter-widgets/base", 966 | "_view_module_version": "1.2.0", 967 | "_view_name": "StyleView", 968 | "bar_color": null, 969 | "description_width": "" 970 | } 971 | }, 972 | "45d3b0c6c5024804a90cbbc2ba936443": { 973 | "model_module": "@jupyter-widgets/base", 974 | "model_module_version": "1.2.0", 975 | "model_name": "LayoutModel", 976 | "state": { 977 | "_model_module": "@jupyter-widgets/base", 978 | "_model_module_version": "1.2.0", 979 | "_model_name": "LayoutModel", 980 | "_view_count": null, 981 | "_view_module": "@jupyter-widgets/base", 982 | "_view_module_version": "1.2.0", 983 | "_view_name": "LayoutView", 984 | "align_content": null, 985 | "align_items": null, 986 | "align_self": null, 987 | "border": null, 988 | "bottom": null, 989 | "display": null, 990 | "flex": null, 991 | "flex_flow": null, 992 | "grid_area": null, 993 | "grid_auto_columns": null, 994 | "grid_auto_flow": null, 995 | "grid_auto_rows": null, 996 | "grid_column": null, 997 | "grid_gap": null, 998 | "grid_row": null, 999 | "grid_template_areas": null, 1000 | "grid_template_columns": null, 1001 | "grid_template_rows": null, 1002 | "height": null, 1003 | "justify_content": null, 1004 | "justify_items": null, 1005 | "left": null, 1006 | "margin": null, 1007 | "max_height": null, 1008 | "max_width": null, 1009 | "min_height": null, 1010 | "min_width": null, 1011 | "object_fit": null, 1012 | "object_position": null, 1013 | "order": null, 1014 | "overflow": null, 1015 | "overflow_x": null, 1016 | "overflow_y": null, 1017 | "padding": null, 1018 | "right": null, 1019 | "top": null, 1020 | "visibility": null, 1021 | "width": null 1022 | } 1023 | }, 1024 | "496f405fdfcd478a8827bfcc09e688ff": { 1025 | "model_module": "@jupyter-widgets/base", 1026 | "model_module_version": "1.2.0", 1027 | "model_name": "LayoutModel", 1028 | "state": { 1029 | "_model_module": "@jupyter-widgets/base", 1030 | "_model_module_version": "1.2.0", 1031 | "_model_name": "LayoutModel", 1032 | "_view_count": null, 1033 | "_view_module": "@jupyter-widgets/base", 1034 | "_view_module_version": "1.2.0", 1035 | "_view_name": "LayoutView", 1036 | "align_content": null, 1037 | "align_items": null, 1038 | "align_self": null, 1039 | "border": null, 1040 | "bottom": null, 1041 | "display": null, 1042 | "flex": null, 1043 | "flex_flow": null, 1044 | "grid_area": null, 1045 | "grid_auto_columns": null, 1046 | "grid_auto_flow": null, 1047 | "grid_auto_rows": null, 1048 | "grid_column": null, 1049 | "grid_gap": null, 1050 | "grid_row": null, 1051 | "grid_template_areas": null, 1052 | "grid_template_columns": null, 1053 | "grid_template_rows": null, 1054 | "height": null, 1055 | "justify_content": null, 1056 | "justify_items": null, 1057 | "left": null, 1058 | "margin": null, 1059 | "max_height": null, 1060 | "max_width": null, 1061 | "min_height": null, 1062 | "min_width": null, 1063 | "object_fit": null, 1064 | "object_position": null, 1065 | "order": null, 1066 | "overflow": null, 1067 | "overflow_x": null, 1068 | "overflow_y": null, 1069 | "padding": null, 1070 | "right": null, 1071 | "top": null, 1072 | "visibility": null, 1073 | "width": null 1074 | } 1075 | }, 1076 | "51bdbd2f4a1b4b39901d3e965aed424a": { 1077 | "model_module": "@jupyter-widgets/controls", 1078 | "model_module_version": "1.5.0", 1079 | "model_name": "HBoxModel", 1080 | "state": { 1081 | "_dom_classes": [], 1082 | "_model_module": "@jupyter-widgets/controls", 1083 | "_model_module_version": "1.5.0", 1084 | "_model_name": "HBoxModel", 1085 | "_view_count": null, 1086 | "_view_module": "@jupyter-widgets/controls", 1087 | "_view_module_version": "1.5.0", 1088 | "_view_name": "HBoxView", 1089 | "box_style": "", 1090 | "children": [ 1091 | "IPY_MODEL_1a7b70b040ed444b9a5090f5d1f50297", 1092 | "IPY_MODEL_42ebaa64ad7a453fb7fef43137411210", 1093 | "IPY_MODEL_0ba53fc0dc264a6eb1b531164c563779" 1094 | ], 1095 | "layout": "IPY_MODEL_67949597f0e748c49b619ac4ecb23385" 1096 | } 1097 | }, 1098 | "51d5674a3f8c4297b2111a12c2abed00": { 1099 | "model_module": "@jupyter-widgets/controls", 1100 | "model_module_version": "1.5.0", 1101 | "model_name": "ProgressStyleModel", 1102 | "state": { 1103 | "_model_module": "@jupyter-widgets/controls", 1104 | "_model_module_version": "1.5.0", 1105 | "_model_name": "ProgressStyleModel", 1106 | "_view_count": null, 1107 | "_view_module": "@jupyter-widgets/base", 1108 | "_view_module_version": "1.2.0", 1109 | "_view_name": "StyleView", 1110 | "bar_color": null, 1111 | "description_width": "" 1112 | } 1113 | }, 1114 | "5388285aaf484406a49580d52c753ffd": { 1115 | "model_module": "@jupyter-widgets/controls", 1116 | "model_module_version": "1.5.0", 1117 | "model_name": "DescriptionStyleModel", 1118 | "state": { 1119 | "_model_module": "@jupyter-widgets/controls", 1120 | "_model_module_version": "1.5.0", 1121 | "_model_name": "DescriptionStyleModel", 1122 | "_view_count": null, 1123 | "_view_module": "@jupyter-widgets/base", 1124 | "_view_module_version": "1.2.0", 1125 | "_view_name": "StyleView", 1126 | "description_width": "" 1127 | } 1128 | }, 1129 | "539d97fe849d4dd4a37fd7817d176014": { 1130 | "model_module": "@jupyter-widgets/controls", 1131 | "model_module_version": "1.5.0", 1132 | "model_name": "FloatProgressModel", 1133 | "state": { 1134 | "_dom_classes": [], 1135 | "_model_module": "@jupyter-widgets/controls", 1136 | "_model_module_version": "1.5.0", 1137 | "_model_name": "FloatProgressModel", 1138 | "_view_count": null, 1139 | "_view_module": "@jupyter-widgets/controls", 1140 | "_view_module_version": "1.5.0", 1141 | "_view_name": "ProgressView", 1142 | "bar_style": "success", 1143 | "description": "", 1144 | "description_tooltip": null, 1145 | "layout": "IPY_MODEL_53c43af3fbc34a8e9daaabe8a1480c4d", 1146 | "max": 548105171, 1147 | "min": 0, 1148 | "orientation": "horizontal", 1149 | "style": "IPY_MODEL_18eb7e8cce3b40dcb0c3b2f1d6f07bed", 1150 | "value": 548105171 1151 | } 1152 | }, 1153 | "53c43af3fbc34a8e9daaabe8a1480c4d": { 1154 | "model_module": "@jupyter-widgets/base", 1155 | "model_module_version": "1.2.0", 1156 | "model_name": "LayoutModel", 1157 | "state": { 1158 | "_model_module": "@jupyter-widgets/base", 1159 | "_model_module_version": "1.2.0", 1160 | "_model_name": "LayoutModel", 1161 | "_view_count": null, 1162 | "_view_module": "@jupyter-widgets/base", 1163 | "_view_module_version": "1.2.0", 1164 | "_view_name": "LayoutView", 1165 | "align_content": null, 1166 | "align_items": null, 1167 | "align_self": null, 1168 | "border": null, 1169 | "bottom": null, 1170 | "display": null, 1171 | "flex": null, 1172 | "flex_flow": null, 1173 | "grid_area": null, 1174 | "grid_auto_columns": null, 1175 | "grid_auto_flow": null, 1176 | "grid_auto_rows": null, 1177 | "grid_column": null, 1178 | "grid_gap": null, 1179 | "grid_row": null, 1180 | "grid_template_areas": null, 1181 | "grid_template_columns": null, 1182 | "grid_template_rows": null, 1183 | "height": null, 1184 | "justify_content": null, 1185 | "justify_items": null, 1186 | "left": null, 1187 | "margin": null, 1188 | "max_height": null, 1189 | "max_width": null, 1190 | "min_height": null, 1191 | "min_width": null, 1192 | "object_fit": null, 1193 | "object_position": null, 1194 | "order": null, 1195 | "overflow": null, 1196 | "overflow_x": null, 1197 | "overflow_y": null, 1198 | "padding": null, 1199 | "right": null, 1200 | "top": null, 1201 | "visibility": null, 1202 | "width": null 1203 | } 1204 | }, 1205 | "53de228e654a4cbb918a232675adf786": { 1206 | "model_module": "@jupyter-widgets/controls", 1207 | "model_module_version": "1.5.0", 1208 | "model_name": "HTMLModel", 1209 | "state": { 1210 | "_dom_classes": [], 1211 | "_model_module": "@jupyter-widgets/controls", 1212 | "_model_module_version": "1.5.0", 1213 | "_model_name": "HTMLModel", 1214 | "_view_count": null, 1215 | "_view_module": "@jupyter-widgets/controls", 1216 | "_view_module_version": "1.5.0", 1217 | "_view_name": "HTMLView", 1218 | "description": "", 1219 | "description_tooltip": null, 1220 | "layout": "IPY_MODEL_d6d8f38e1c8a4cb1a0872ecff965dbfa", 1221 | "placeholder": "​", 1222 | "style": "IPY_MODEL_3b2f1207b949406b8b71839fc13c4fdf", 1223 | "value": "model.safetensors: 100%" 1224 | } 1225 | }, 1226 | "54b53530db81456c86661b95370289b2": { 1227 | "model_module": "@jupyter-widgets/controls", 1228 | "model_module_version": "1.5.0", 1229 | "model_name": "DescriptionStyleModel", 1230 | "state": { 1231 | "_model_module": "@jupyter-widgets/controls", 1232 | "_model_module_version": "1.5.0", 1233 | "_model_name": "DescriptionStyleModel", 1234 | "_view_count": null, 1235 | "_view_module": "@jupyter-widgets/base", 1236 | "_view_module_version": "1.2.0", 1237 | "_view_name": "StyleView", 1238 | "description_width": "" 1239 | } 1240 | }, 1241 | "589c2eaf6c0044ad845f6e9e53f3a477": { 1242 | "model_module": "@jupyter-widgets/base", 1243 | "model_module_version": "1.2.0", 1244 | "model_name": "LayoutModel", 1245 | "state": { 1246 | "_model_module": "@jupyter-widgets/base", 1247 | "_model_module_version": "1.2.0", 1248 | "_model_name": "LayoutModel", 1249 | "_view_count": null, 1250 | "_view_module": "@jupyter-widgets/base", 1251 | "_view_module_version": "1.2.0", 1252 | "_view_name": "LayoutView", 1253 | "align_content": null, 1254 | "align_items": null, 1255 | "align_self": null, 1256 | "border": null, 1257 | "bottom": null, 1258 | "display": null, 1259 | "flex": null, 1260 | "flex_flow": null, 1261 | "grid_area": null, 1262 | "grid_auto_columns": null, 1263 | "grid_auto_flow": null, 1264 | "grid_auto_rows": null, 1265 | "grid_column": null, 1266 | "grid_gap": null, 1267 | "grid_row": null, 1268 | "grid_template_areas": null, 1269 | "grid_template_columns": null, 1270 | "grid_template_rows": null, 1271 | "height": null, 1272 | "justify_content": null, 1273 | "justify_items": null, 1274 | "left": null, 1275 | "margin": null, 1276 | "max_height": null, 1277 | "max_width": null, 1278 | "min_height": null, 1279 | "min_width": null, 1280 | "object_fit": null, 1281 | "object_position": null, 1282 | "order": null, 1283 | "overflow": null, 1284 | "overflow_x": null, 1285 | "overflow_y": null, 1286 | "padding": null, 1287 | "right": null, 1288 | "top": null, 1289 | "visibility": null, 1290 | "width": null 1291 | } 1292 | }, 1293 | "5a005a1510c74e08bc0af1c59e180c7d": { 1294 | "model_module": "@jupyter-widgets/controls", 1295 | "model_module_version": "1.5.0", 1296 | "model_name": "HTMLModel", 1297 | "state": { 1298 | "_dom_classes": [], 1299 | "_model_module": "@jupyter-widgets/controls", 1300 | "_model_module_version": "1.5.0", 1301 | "_model_name": "HTMLModel", 1302 | "_view_count": null, 1303 | "_view_module": "@jupyter-widgets/controls", 1304 | "_view_module_version": "1.5.0", 1305 | "_view_name": "HTMLView", 1306 | "description": "", 1307 | "description_tooltip": null, 1308 | "layout": "IPY_MODEL_b75fc0d7210544a68dddf356f647c44a", 1309 | "placeholder": "​", 1310 | "style": "IPY_MODEL_54b53530db81456c86661b95370289b2", 1311 | "value": " 124/124 [00:00<00:00, 12.3kB/s]" 1312 | } 1313 | }, 1314 | "5bc4e02a6d114b3a97a043a141f765b4": { 1315 | "model_module": "@jupyter-widgets/base", 1316 | "model_module_version": "1.2.0", 1317 | "model_name": "LayoutModel", 1318 | "state": { 1319 | "_model_module": "@jupyter-widgets/base", 1320 | "_model_module_version": "1.2.0", 1321 | "_model_name": "LayoutModel", 1322 | "_view_count": null, 1323 | "_view_module": "@jupyter-widgets/base", 1324 | "_view_module_version": "1.2.0", 1325 | "_view_name": "LayoutView", 1326 | "align_content": null, 1327 | "align_items": null, 1328 | "align_self": null, 1329 | "border": null, 1330 | "bottom": null, 1331 | "display": null, 1332 | "flex": null, 1333 | "flex_flow": null, 1334 | "grid_area": null, 1335 | "grid_auto_columns": null, 1336 | "grid_auto_flow": null, 1337 | "grid_auto_rows": null, 1338 | "grid_column": null, 1339 | "grid_gap": null, 1340 | "grid_row": null, 1341 | "grid_template_areas": null, 1342 | "grid_template_columns": null, 1343 | "grid_template_rows": null, 1344 | "height": null, 1345 | "justify_content": null, 1346 | "justify_items": null, 1347 | "left": null, 1348 | "margin": null, 1349 | "max_height": null, 1350 | "max_width": null, 1351 | "min_height": null, 1352 | "min_width": null, 1353 | "object_fit": null, 1354 | "object_position": null, 1355 | "order": null, 1356 | "overflow": null, 1357 | "overflow_x": null, 1358 | "overflow_y": null, 1359 | "padding": null, 1360 | "right": null, 1361 | "top": null, 1362 | "visibility": null, 1363 | "width": null 1364 | } 1365 | }, 1366 | "6349d308618c43beaf55d6e1f10ae188": { 1367 | "model_module": "@jupyter-widgets/controls", 1368 | "model_module_version": "1.5.0", 1369 | "model_name": "FloatProgressModel", 1370 | "state": { 1371 | "_dom_classes": [], 1372 | "_model_module": "@jupyter-widgets/controls", 1373 | "_model_module_version": "1.5.0", 1374 | "_model_name": "FloatProgressModel", 1375 | "_view_count": null, 1376 | "_view_module": "@jupyter-widgets/controls", 1377 | "_view_module_version": "1.5.0", 1378 | "_view_name": "ProgressView", 1379 | "bar_style": "success", 1380 | "description": "", 1381 | "description_tooltip": null, 1382 | "layout": "IPY_MODEL_6e40dee5246c43778549be259de7e4b1", 1383 | "max": 124, 1384 | "min": 0, 1385 | "orientation": "horizontal", 1386 | "style": "IPY_MODEL_d7fd21f5a06441b887f6d7efcf427512", 1387 | "value": 124 1388 | } 1389 | }, 1390 | "66d0c504b4e044dfb418f6213fec1eb5": { 1391 | "model_module": "@jupyter-widgets/controls", 1392 | "model_module_version": "1.5.0", 1393 | "model_name": "HTMLModel", 1394 | "state": { 1395 | "_dom_classes": [], 1396 | "_model_module": "@jupyter-widgets/controls", 1397 | "_model_module_version": "1.5.0", 1398 | "_model_name": "HTMLModel", 1399 | "_view_count": null, 1400 | "_view_module": "@jupyter-widgets/controls", 1401 | "_view_module_version": "1.5.0", 1402 | "_view_name": "HTMLView", 1403 | "description": "", 1404 | "description_tooltip": null, 1405 | "layout": "IPY_MODEL_2144b7805b7e4c9c90f41405ebcb2c4b", 1406 | "placeholder": "​", 1407 | "style": "IPY_MODEL_3788698b38554d248d1516d911118b4d", 1408 | "value": " 1.04M/1.04M [00:00<00:00, 4.26MB/s]" 1409 | } 1410 | }, 1411 | "6765f799cb9843f7b7d5c058061378c8": { 1412 | "model_module": "@jupyter-widgets/controls", 1413 | "model_module_version": "1.5.0", 1414 | "model_name": "HBoxModel", 1415 | "state": { 1416 | "_dom_classes": [], 1417 | "_model_module": "@jupyter-widgets/controls", 1418 | "_model_module_version": "1.5.0", 1419 | "_model_name": "HBoxModel", 1420 | "_view_count": null, 1421 | "_view_module": "@jupyter-widgets/controls", 1422 | "_view_module_version": "1.5.0", 1423 | "_view_name": "HBoxView", 1424 | "box_style": "", 1425 | "children": [ 1426 | "IPY_MODEL_0ce52871be5b4bd1bddcbd7cbaebd008", 1427 | "IPY_MODEL_fb898a36c26845b49147b3d9c143ed12", 1428 | "IPY_MODEL_66d0c504b4e044dfb418f6213fec1eb5" 1429 | ], 1430 | "layout": "IPY_MODEL_fd234cc407754bd2855d827a04efec41" 1431 | } 1432 | }, 1433 | "67949597f0e748c49b619ac4ecb23385": { 1434 | "model_module": "@jupyter-widgets/base", 1435 | "model_module_version": "1.2.0", 1436 | "model_name": "LayoutModel", 1437 | "state": { 1438 | "_model_module": "@jupyter-widgets/base", 1439 | "_model_module_version": "1.2.0", 1440 | "_model_name": "LayoutModel", 1441 | "_view_count": null, 1442 | "_view_module": "@jupyter-widgets/base", 1443 | "_view_module_version": "1.2.0", 1444 | "_view_name": "LayoutView", 1445 | "align_content": null, 1446 | "align_items": null, 1447 | "align_self": null, 1448 | "border": null, 1449 | "bottom": null, 1450 | "display": null, 1451 | "flex": null, 1452 | "flex_flow": null, 1453 | "grid_area": null, 1454 | "grid_auto_columns": null, 1455 | "grid_auto_flow": null, 1456 | "grid_auto_rows": null, 1457 | "grid_column": null, 1458 | "grid_gap": null, 1459 | "grid_row": null, 1460 | "grid_template_areas": null, 1461 | "grid_template_columns": null, 1462 | "grid_template_rows": null, 1463 | "height": null, 1464 | "justify_content": null, 1465 | "justify_items": null, 1466 | "left": null, 1467 | "margin": null, 1468 | "max_height": null, 1469 | "max_width": null, 1470 | "min_height": null, 1471 | "min_width": null, 1472 | "object_fit": null, 1473 | "object_position": null, 1474 | "order": null, 1475 | "overflow": null, 1476 | "overflow_x": null, 1477 | "overflow_y": null, 1478 | "padding": null, 1479 | "right": null, 1480 | "top": null, 1481 | "visibility": null, 1482 | "width": null 1483 | } 1484 | }, 1485 | "6df619f4469d4742aae74bd72cbe84c1": { 1486 | "model_module": "@jupyter-widgets/controls", 1487 | "model_module_version": "1.5.0", 1488 | "model_name": "DescriptionStyleModel", 1489 | "state": { 1490 | "_model_module": "@jupyter-widgets/controls", 1491 | "_model_module_version": "1.5.0", 1492 | "_model_name": "DescriptionStyleModel", 1493 | "_view_count": null, 1494 | "_view_module": "@jupyter-widgets/base", 1495 | "_view_module_version": "1.2.0", 1496 | "_view_name": "StyleView", 1497 | "description_width": "" 1498 | } 1499 | }, 1500 | "6e40dee5246c43778549be259de7e4b1": { 1501 | "model_module": "@jupyter-widgets/base", 1502 | "model_module_version": "1.2.0", 1503 | "model_name": "LayoutModel", 1504 | "state": { 1505 | "_model_module": "@jupyter-widgets/base", 1506 | "_model_module_version": "1.2.0", 1507 | "_model_name": "LayoutModel", 1508 | "_view_count": null, 1509 | "_view_module": "@jupyter-widgets/base", 1510 | "_view_module_version": "1.2.0", 1511 | "_view_name": "LayoutView", 1512 | "align_content": null, 1513 | "align_items": null, 1514 | "align_self": null, 1515 | "border": null, 1516 | "bottom": null, 1517 | "display": null, 1518 | "flex": null, 1519 | "flex_flow": null, 1520 | "grid_area": null, 1521 | "grid_auto_columns": null, 1522 | "grid_auto_flow": null, 1523 | "grid_auto_rows": null, 1524 | "grid_column": null, 1525 | "grid_gap": null, 1526 | "grid_row": null, 1527 | "grid_template_areas": null, 1528 | "grid_template_columns": null, 1529 | "grid_template_rows": null, 1530 | "height": null, 1531 | "justify_content": null, 1532 | "justify_items": null, 1533 | "left": null, 1534 | "margin": null, 1535 | "max_height": null, 1536 | "max_width": null, 1537 | "min_height": null, 1538 | "min_width": null, 1539 | "object_fit": null, 1540 | "object_position": null, 1541 | "order": null, 1542 | "overflow": null, 1543 | "overflow_x": null, 1544 | "overflow_y": null, 1545 | "padding": null, 1546 | "right": null, 1547 | "top": null, 1548 | "visibility": null, 1549 | "width": null 1550 | } 1551 | }, 1552 | "72fe31effb6e456da776668b9661f081": { 1553 | "model_module": "@jupyter-widgets/controls", 1554 | "model_module_version": "1.5.0", 1555 | "model_name": "HTMLModel", 1556 | "state": { 1557 | "_dom_classes": [], 1558 | "_model_module": "@jupyter-widgets/controls", 1559 | "_model_module_version": "1.5.0", 1560 | "_model_name": "HTMLModel", 1561 | "_view_count": null, 1562 | "_view_module": "@jupyter-widgets/controls", 1563 | "_view_module_version": "1.5.0", 1564 | "_view_name": "HTMLView", 1565 | "description": "", 1566 | "description_tooltip": null, 1567 | "layout": "IPY_MODEL_a5768ae07a4d40b1ad08b00afc5809d9", 1568 | "placeholder": "​", 1569 | "style": "IPY_MODEL_e438848f9acd4445ad9b4467be3559c5", 1570 | "value": " 1.36M/1.36M [00:00<00:00, 5.21MB/s]" 1571 | } 1572 | }, 1573 | "762b99c3ade9437dabec35e64f0a0e62": { 1574 | "model_module": "@jupyter-widgets/controls", 1575 | "model_module_version": "1.5.0", 1576 | "model_name": "DescriptionStyleModel", 1577 | "state": { 1578 | "_model_module": "@jupyter-widgets/controls", 1579 | "_model_module_version": "1.5.0", 1580 | "_model_name": "DescriptionStyleModel", 1581 | "_view_count": null, 1582 | "_view_module": "@jupyter-widgets/base", 1583 | "_view_module_version": "1.2.0", 1584 | "_view_name": "StyleView", 1585 | "description_width": "" 1586 | } 1587 | }, 1588 | "77835887a1334e35a53cd2fdba258456": { 1589 | "model_module": "@jupyter-widgets/controls", 1590 | "model_module_version": "1.5.0", 1591 | "model_name": "DescriptionStyleModel", 1592 | "state": { 1593 | "_model_module": "@jupyter-widgets/controls", 1594 | "_model_module_version": "1.5.0", 1595 | "_model_name": "DescriptionStyleModel", 1596 | "_view_count": null, 1597 | "_view_module": "@jupyter-widgets/base", 1598 | "_view_module_version": "1.2.0", 1599 | "_view_name": "StyleView", 1600 | "description_width": "" 1601 | } 1602 | }, 1603 | "83dae3f65be04079ba91f7af373ce8e3": { 1604 | "model_module": "@jupyter-widgets/controls", 1605 | "model_module_version": "1.5.0", 1606 | "model_name": "HTMLModel", 1607 | "state": { 1608 | "_dom_classes": [], 1609 | "_model_module": "@jupyter-widgets/controls", 1610 | "_model_module_version": "1.5.0", 1611 | "_model_name": "HTMLModel", 1612 | "_view_count": null, 1613 | "_view_module": "@jupyter-widgets/controls", 1614 | "_view_module_version": "1.5.0", 1615 | "_view_name": "HTMLView", 1616 | "description": "", 1617 | "description_tooltip": null, 1618 | "layout": "IPY_MODEL_0e430d32d3a743a5831d993ee23488c5", 1619 | "placeholder": "​", 1620 | "style": "IPY_MODEL_d5aea3fe6d48494f813a5e30127c45a7", 1621 | "value": "merges.txt: 100%" 1622 | } 1623 | }, 1624 | "8f2cfeecc96340fda657b5e51feca4af": { 1625 | "model_module": "@jupyter-widgets/base", 1626 | "model_module_version": "1.2.0", 1627 | "model_name": "LayoutModel", 1628 | "state": { 1629 | "_model_module": "@jupyter-widgets/base", 1630 | "_model_module_version": "1.2.0", 1631 | "_model_name": "LayoutModel", 1632 | "_view_count": null, 1633 | "_view_module": "@jupyter-widgets/base", 1634 | "_view_module_version": "1.2.0", 1635 | "_view_name": "LayoutView", 1636 | "align_content": null, 1637 | "align_items": null, 1638 | "align_self": null, 1639 | "border": null, 1640 | "bottom": null, 1641 | "display": null, 1642 | "flex": null, 1643 | "flex_flow": null, 1644 | "grid_area": null, 1645 | "grid_auto_columns": null, 1646 | "grid_auto_flow": null, 1647 | "grid_auto_rows": null, 1648 | "grid_column": null, 1649 | "grid_gap": null, 1650 | "grid_row": null, 1651 | "grid_template_areas": null, 1652 | "grid_template_columns": null, 1653 | "grid_template_rows": null, 1654 | "height": null, 1655 | "justify_content": null, 1656 | "justify_items": null, 1657 | "left": null, 1658 | "margin": null, 1659 | "max_height": null, 1660 | "max_width": null, 1661 | "min_height": null, 1662 | "min_width": null, 1663 | "object_fit": null, 1664 | "object_position": null, 1665 | "order": null, 1666 | "overflow": null, 1667 | "overflow_x": null, 1668 | "overflow_y": null, 1669 | "padding": null, 1670 | "right": null, 1671 | "top": null, 1672 | "visibility": null, 1673 | "width": null 1674 | } 1675 | }, 1676 | "94ed621363294d03ba922bdeb3d2d9ca": { 1677 | "model_module": "@jupyter-widgets/controls", 1678 | "model_module_version": "1.5.0", 1679 | "model_name": "HTMLModel", 1680 | "state": { 1681 | "_dom_classes": [], 1682 | "_model_module": "@jupyter-widgets/controls", 1683 | "_model_module_version": "1.5.0", 1684 | "_model_name": "HTMLModel", 1685 | "_view_count": null, 1686 | "_view_module": "@jupyter-widgets/controls", 1687 | "_view_module_version": "1.5.0", 1688 | "_view_name": "HTMLView", 1689 | "description": "", 1690 | "description_tooltip": null, 1691 | "layout": "IPY_MODEL_eb19d381c4784e5f84c4303c113b09bf", 1692 | "placeholder": "​", 1693 | "style": "IPY_MODEL_c084da4740a84edca925f547952b5c73", 1694 | "value": " 665/665 [00:00<00:00, 63.2kB/s]" 1695 | } 1696 | }, 1697 | "9edc27e7dbc84021881bc47c8578740f": { 1698 | "model_module": "@jupyter-widgets/base", 1699 | "model_module_version": "1.2.0", 1700 | "model_name": "LayoutModel", 1701 | "state": { 1702 | "_model_module": "@jupyter-widgets/base", 1703 | "_model_module_version": "1.2.0", 1704 | "_model_name": "LayoutModel", 1705 | "_view_count": null, 1706 | "_view_module": "@jupyter-widgets/base", 1707 | "_view_module_version": "1.2.0", 1708 | "_view_name": "LayoutView", 1709 | "align_content": null, 1710 | "align_items": null, 1711 | "align_self": null, 1712 | "border": null, 1713 | "bottom": null, 1714 | "display": null, 1715 | "flex": null, 1716 | "flex_flow": null, 1717 | "grid_area": null, 1718 | "grid_auto_columns": null, 1719 | "grid_auto_flow": null, 1720 | "grid_auto_rows": null, 1721 | "grid_column": null, 1722 | "grid_gap": null, 1723 | "grid_row": null, 1724 | "grid_template_areas": null, 1725 | "grid_template_columns": null, 1726 | "grid_template_rows": null, 1727 | "height": null, 1728 | "justify_content": null, 1729 | "justify_items": null, 1730 | "left": null, 1731 | "margin": null, 1732 | "max_height": null, 1733 | "max_width": null, 1734 | "min_height": null, 1735 | "min_width": null, 1736 | "object_fit": null, 1737 | "object_position": null, 1738 | "order": null, 1739 | "overflow": null, 1740 | "overflow_x": null, 1741 | "overflow_y": null, 1742 | "padding": null, 1743 | "right": null, 1744 | "top": null, 1745 | "visibility": null, 1746 | "width": null 1747 | } 1748 | }, 1749 | "a0d1bcd896c447d088510d4ad58b6819": { 1750 | "model_module": "@jupyter-widgets/controls", 1751 | "model_module_version": "1.5.0", 1752 | "model_name": "FloatProgressModel", 1753 | "state": { 1754 | "_dom_classes": [], 1755 | "_model_module": "@jupyter-widgets/controls", 1756 | "_model_module_version": "1.5.0", 1757 | "_model_name": "FloatProgressModel", 1758 | "_view_count": null, 1759 | "_view_module": "@jupyter-widgets/controls", 1760 | "_view_module_version": "1.5.0", 1761 | "_view_name": "ProgressView", 1762 | "bar_style": "success", 1763 | "description": "", 1764 | "description_tooltip": null, 1765 | "layout": "IPY_MODEL_3032d78ba7914c61b314babf08b0063e", 1766 | "max": 665, 1767 | "min": 0, 1768 | "orientation": "horizontal", 1769 | "style": "IPY_MODEL_452ee4a6a62346fe91f66cb00f619cee", 1770 | "value": 665 1771 | } 1772 | }, 1773 | "a5768ae07a4d40b1ad08b00afc5809d9": { 1774 | "model_module": "@jupyter-widgets/base", 1775 | "model_module_version": "1.2.0", 1776 | "model_name": "LayoutModel", 1777 | "state": { 1778 | "_model_module": "@jupyter-widgets/base", 1779 | "_model_module_version": "1.2.0", 1780 | "_model_name": "LayoutModel", 1781 | "_view_count": null, 1782 | "_view_module": "@jupyter-widgets/base", 1783 | "_view_module_version": "1.2.0", 1784 | "_view_name": "LayoutView", 1785 | "align_content": null, 1786 | "align_items": null, 1787 | "align_self": null, 1788 | "border": null, 1789 | "bottom": null, 1790 | "display": null, 1791 | "flex": null, 1792 | "flex_flow": null, 1793 | "grid_area": null, 1794 | "grid_auto_columns": null, 1795 | "grid_auto_flow": null, 1796 | "grid_auto_rows": null, 1797 | "grid_column": null, 1798 | "grid_gap": null, 1799 | "grid_row": null, 1800 | "grid_template_areas": null, 1801 | "grid_template_columns": null, 1802 | "grid_template_rows": null, 1803 | "height": null, 1804 | "justify_content": null, 1805 | "justify_items": null, 1806 | "left": null, 1807 | "margin": null, 1808 | "max_height": null, 1809 | "max_width": null, 1810 | "min_height": null, 1811 | "min_width": null, 1812 | "object_fit": null, 1813 | "object_position": null, 1814 | "order": null, 1815 | "overflow": null, 1816 | "overflow_x": null, 1817 | "overflow_y": null, 1818 | "padding": null, 1819 | "right": null, 1820 | "top": null, 1821 | "visibility": null, 1822 | "width": null 1823 | } 1824 | }, 1825 | "a6e84c46d198439fa1ae1001d5258e54": { 1826 | "model_module": "@jupyter-widgets/controls", 1827 | "model_module_version": "1.5.0", 1828 | "model_name": "HBoxModel", 1829 | "state": { 1830 | "_dom_classes": [], 1831 | "_model_module": "@jupyter-widgets/controls", 1832 | "_model_module_version": "1.5.0", 1833 | "_model_name": "HBoxModel", 1834 | "_view_count": null, 1835 | "_view_module": "@jupyter-widgets/controls", 1836 | "_view_module_version": "1.5.0", 1837 | "_view_name": "HBoxView", 1838 | "box_style": "", 1839 | "children": [ 1840 | "IPY_MODEL_53de228e654a4cbb918a232675adf786", 1841 | "IPY_MODEL_539d97fe849d4dd4a37fd7817d176014", 1842 | "IPY_MODEL_2a27dc7041dc46da8d7a29de5c86c7e5" 1843 | ], 1844 | "layout": "IPY_MODEL_c5ad154d6092483588ab43d0a1ff2ff0" 1845 | } 1846 | }, 1847 | "a9c5843b041b4ca99cd62dd09eb23a2b": { 1848 | "model_module": "@jupyter-widgets/controls", 1849 | "model_module_version": "1.5.0", 1850 | "model_name": "DescriptionStyleModel", 1851 | "state": { 1852 | "_model_module": "@jupyter-widgets/controls", 1853 | "_model_module_version": "1.5.0", 1854 | "_model_name": "DescriptionStyleModel", 1855 | "_view_count": null, 1856 | "_view_module": "@jupyter-widgets/base", 1857 | "_view_module_version": "1.2.0", 1858 | "_view_name": "StyleView", 1859 | "description_width": "" 1860 | } 1861 | }, 1862 | "aaf1ac823aac489ca591ff0cc635423f": { 1863 | "model_module": "@jupyter-widgets/controls", 1864 | "model_module_version": "1.5.0", 1865 | "model_name": "DescriptionStyleModel", 1866 | "state": { 1867 | "_model_module": "@jupyter-widgets/controls", 1868 | "_model_module_version": "1.5.0", 1869 | "_model_name": "DescriptionStyleModel", 1870 | "_view_count": null, 1871 | "_view_module": "@jupyter-widgets/base", 1872 | "_view_module_version": "1.2.0", 1873 | "_view_name": "StyleView", 1874 | "description_width": "" 1875 | } 1876 | }, 1877 | "ac63aa65d1834a9c975b4aee7226b7a3": { 1878 | "model_module": "@jupyter-widgets/controls", 1879 | "model_module_version": "1.5.0", 1880 | "model_name": "FloatProgressModel", 1881 | "state": { 1882 | "_dom_classes": [], 1883 | "_model_module": "@jupyter-widgets/controls", 1884 | "_model_module_version": "1.5.0", 1885 | "_model_name": "FloatProgressModel", 1886 | "_view_count": null, 1887 | "_view_module": "@jupyter-widgets/controls", 1888 | "_view_module_version": "1.5.0", 1889 | "_view_name": "ProgressView", 1890 | "bar_style": "success", 1891 | "description": "", 1892 | "description_tooltip": null, 1893 | "layout": "IPY_MODEL_9edc27e7dbc84021881bc47c8578740f", 1894 | "max": 1355256, 1895 | "min": 0, 1896 | "orientation": "horizontal", 1897 | "style": "IPY_MODEL_51d5674a3f8c4297b2111a12c2abed00", 1898 | "value": 1355256 1899 | } 1900 | }, 1901 | "ad05b4c7c5b64ac59bfdeecd4867452c": { 1902 | "model_module": "@jupyter-widgets/base", 1903 | "model_module_version": "1.2.0", 1904 | "model_name": "LayoutModel", 1905 | "state": { 1906 | "_model_module": "@jupyter-widgets/base", 1907 | "_model_module_version": "1.2.0", 1908 | "_model_name": "LayoutModel", 1909 | "_view_count": null, 1910 | "_view_module": "@jupyter-widgets/base", 1911 | "_view_module_version": "1.2.0", 1912 | "_view_name": "LayoutView", 1913 | "align_content": null, 1914 | "align_items": null, 1915 | "align_self": null, 1916 | "border": null, 1917 | "bottom": null, 1918 | "display": null, 1919 | "flex": null, 1920 | "flex_flow": null, 1921 | "grid_area": null, 1922 | "grid_auto_columns": null, 1923 | "grid_auto_flow": null, 1924 | "grid_auto_rows": null, 1925 | "grid_column": null, 1926 | "grid_gap": null, 1927 | "grid_row": null, 1928 | "grid_template_areas": null, 1929 | "grid_template_columns": null, 1930 | "grid_template_rows": null, 1931 | "height": null, 1932 | "justify_content": null, 1933 | "justify_items": null, 1934 | "left": null, 1935 | "margin": null, 1936 | "max_height": null, 1937 | "max_width": null, 1938 | "min_height": null, 1939 | "min_width": null, 1940 | "object_fit": null, 1941 | "object_position": null, 1942 | "order": null, 1943 | "overflow": null, 1944 | "overflow_x": null, 1945 | "overflow_y": null, 1946 | "padding": null, 1947 | "right": null, 1948 | "top": null, 1949 | "visibility": null, 1950 | "width": null 1951 | } 1952 | }, 1953 | "ad1b8147bcfa43e5b7a8754f4729d207": { 1954 | "model_module": "@jupyter-widgets/controls", 1955 | "model_module_version": "1.5.0", 1956 | "model_name": "HTMLModel", 1957 | "state": { 1958 | "_dom_classes": [], 1959 | "_model_module": "@jupyter-widgets/controls", 1960 | "_model_module_version": "1.5.0", 1961 | "_model_name": "HTMLModel", 1962 | "_view_count": null, 1963 | "_view_module": "@jupyter-widgets/controls", 1964 | "_view_module_version": "1.5.0", 1965 | "_view_name": "HTMLView", 1966 | "description": "", 1967 | "description_tooltip": null, 1968 | "layout": "IPY_MODEL_ad05b4c7c5b64ac59bfdeecd4867452c", 1969 | "placeholder": "​", 1970 | "style": "IPY_MODEL_db242277b75843f3bd4f4f8947bb579a", 1971 | "value": "tokenizer.json: 100%" 1972 | } 1973 | }, 1974 | "ae2d4a6b262c4228824d21c660919068": { 1975 | "model_module": "@jupyter-widgets/base", 1976 | "model_module_version": "1.2.0", 1977 | "model_name": "LayoutModel", 1978 | "state": { 1979 | "_model_module": "@jupyter-widgets/base", 1980 | "_model_module_version": "1.2.0", 1981 | "_model_name": "LayoutModel", 1982 | "_view_count": null, 1983 | "_view_module": "@jupyter-widgets/base", 1984 | "_view_module_version": "1.2.0", 1985 | "_view_name": "LayoutView", 1986 | "align_content": null, 1987 | "align_items": null, 1988 | "align_self": null, 1989 | "border": null, 1990 | "bottom": null, 1991 | "display": null, 1992 | "flex": null, 1993 | "flex_flow": null, 1994 | "grid_area": null, 1995 | "grid_auto_columns": null, 1996 | "grid_auto_flow": null, 1997 | "grid_auto_rows": null, 1998 | "grid_column": null, 1999 | "grid_gap": null, 2000 | "grid_row": null, 2001 | "grid_template_areas": null, 2002 | "grid_template_columns": null, 2003 | "grid_template_rows": null, 2004 | "height": null, 2005 | "justify_content": null, 2006 | "justify_items": null, 2007 | "left": null, 2008 | "margin": null, 2009 | "max_height": null, 2010 | "max_width": null, 2011 | "min_height": null, 2012 | "min_width": null, 2013 | "object_fit": null, 2014 | "object_position": null, 2015 | "order": null, 2016 | "overflow": null, 2017 | "overflow_x": null, 2018 | "overflow_y": null, 2019 | "padding": null, 2020 | "right": null, 2021 | "top": null, 2022 | "visibility": null, 2023 | "width": null 2024 | } 2025 | }, 2026 | "ae92da64d84345cdaabf8c26693c42bd": { 2027 | "model_module": "@jupyter-widgets/base", 2028 | "model_module_version": "1.2.0", 2029 | "model_name": "LayoutModel", 2030 | "state": { 2031 | "_model_module": "@jupyter-widgets/base", 2032 | "_model_module_version": "1.2.0", 2033 | "_model_name": "LayoutModel", 2034 | "_view_count": null, 2035 | "_view_module": "@jupyter-widgets/base", 2036 | "_view_module_version": "1.2.0", 2037 | "_view_name": "LayoutView", 2038 | "align_content": null, 2039 | "align_items": null, 2040 | "align_self": null, 2041 | "border": null, 2042 | "bottom": null, 2043 | "display": null, 2044 | "flex": null, 2045 | "flex_flow": null, 2046 | "grid_area": null, 2047 | "grid_auto_columns": null, 2048 | "grid_auto_flow": null, 2049 | "grid_auto_rows": null, 2050 | "grid_column": null, 2051 | "grid_gap": null, 2052 | "grid_row": null, 2053 | "grid_template_areas": null, 2054 | "grid_template_columns": null, 2055 | "grid_template_rows": null, 2056 | "height": null, 2057 | "justify_content": null, 2058 | "justify_items": null, 2059 | "left": null, 2060 | "margin": null, 2061 | "max_height": null, 2062 | "max_width": null, 2063 | "min_height": null, 2064 | "min_width": null, 2065 | "object_fit": null, 2066 | "object_position": null, 2067 | "order": null, 2068 | "overflow": null, 2069 | "overflow_x": null, 2070 | "overflow_y": null, 2071 | "padding": null, 2072 | "right": null, 2073 | "top": null, 2074 | "visibility": null, 2075 | "width": null 2076 | } 2077 | }, 2078 | "b75fc0d7210544a68dddf356f647c44a": { 2079 | "model_module": "@jupyter-widgets/base", 2080 | "model_module_version": "1.2.0", 2081 | "model_name": "LayoutModel", 2082 | "state": { 2083 | "_model_module": "@jupyter-widgets/base", 2084 | "_model_module_version": "1.2.0", 2085 | "_model_name": "LayoutModel", 2086 | "_view_count": null, 2087 | "_view_module": "@jupyter-widgets/base", 2088 | "_view_module_version": "1.2.0", 2089 | "_view_name": "LayoutView", 2090 | "align_content": null, 2091 | "align_items": null, 2092 | "align_self": null, 2093 | "border": null, 2094 | "bottom": null, 2095 | "display": null, 2096 | "flex": null, 2097 | "flex_flow": null, 2098 | "grid_area": null, 2099 | "grid_auto_columns": null, 2100 | "grid_auto_flow": null, 2101 | "grid_auto_rows": null, 2102 | "grid_column": null, 2103 | "grid_gap": null, 2104 | "grid_row": null, 2105 | "grid_template_areas": null, 2106 | "grid_template_columns": null, 2107 | "grid_template_rows": null, 2108 | "height": null, 2109 | "justify_content": null, 2110 | "justify_items": null, 2111 | "left": null, 2112 | "margin": null, 2113 | "max_height": null, 2114 | "max_width": null, 2115 | "min_height": null, 2116 | "min_width": null, 2117 | "object_fit": null, 2118 | "object_position": null, 2119 | "order": null, 2120 | "overflow": null, 2121 | "overflow_x": null, 2122 | "overflow_y": null, 2123 | "padding": null, 2124 | "right": null, 2125 | "top": null, 2126 | "visibility": null, 2127 | "width": null 2128 | } 2129 | }, 2130 | "ba9731a6d757403d92f92e9dbe39e432": { 2131 | "model_module": "@jupyter-widgets/base", 2132 | "model_module_version": "1.2.0", 2133 | "model_name": "LayoutModel", 2134 | "state": { 2135 | "_model_module": "@jupyter-widgets/base", 2136 | "_model_module_version": "1.2.0", 2137 | "_model_name": "LayoutModel", 2138 | "_view_count": null, 2139 | "_view_module": "@jupyter-widgets/base", 2140 | "_view_module_version": "1.2.0", 2141 | "_view_name": "LayoutView", 2142 | "align_content": null, 2143 | "align_items": null, 2144 | "align_self": null, 2145 | "border": null, 2146 | "bottom": null, 2147 | "display": null, 2148 | "flex": null, 2149 | "flex_flow": null, 2150 | "grid_area": null, 2151 | "grid_auto_columns": null, 2152 | "grid_auto_flow": null, 2153 | "grid_auto_rows": null, 2154 | "grid_column": null, 2155 | "grid_gap": null, 2156 | "grid_row": null, 2157 | "grid_template_areas": null, 2158 | "grid_template_columns": null, 2159 | "grid_template_rows": null, 2160 | "height": null, 2161 | "justify_content": null, 2162 | "justify_items": null, 2163 | "left": null, 2164 | "margin": null, 2165 | "max_height": null, 2166 | "max_width": null, 2167 | "min_height": null, 2168 | "min_width": null, 2169 | "object_fit": null, 2170 | "object_position": null, 2171 | "order": null, 2172 | "overflow": null, 2173 | "overflow_x": null, 2174 | "overflow_y": null, 2175 | "padding": null, 2176 | "right": null, 2177 | "top": null, 2178 | "visibility": null, 2179 | "width": null 2180 | } 2181 | }, 2182 | "bcfaa671f66e4f778e16e76f98f6f734": { 2183 | "model_module": "@jupyter-widgets/controls", 2184 | "model_module_version": "1.5.0", 2185 | "model_name": "HTMLModel", 2186 | "state": { 2187 | "_dom_classes": [], 2188 | "_model_module": "@jupyter-widgets/controls", 2189 | "_model_module_version": "1.5.0", 2190 | "_model_name": "HTMLModel", 2191 | "_view_count": null, 2192 | "_view_module": "@jupyter-widgets/controls", 2193 | "_view_module_version": "1.5.0", 2194 | "_view_name": "HTMLView", 2195 | "description": "", 2196 | "description_tooltip": null, 2197 | "layout": "IPY_MODEL_f903db4f00184e97b812857ce3506c62", 2198 | "placeholder": "​", 2199 | "style": "IPY_MODEL_a9c5843b041b4ca99cd62dd09eb23a2b", 2200 | "value": " 456k/456k [00:00<00:00, 35.3MB/s]" 2201 | } 2202 | }, 2203 | "bfb59061e8fa4460a321253800257721": { 2204 | "model_module": "@jupyter-widgets/base", 2205 | "model_module_version": "1.2.0", 2206 | "model_name": "LayoutModel", 2207 | "state": { 2208 | "_model_module": "@jupyter-widgets/base", 2209 | "_model_module_version": "1.2.0", 2210 | "_model_name": "LayoutModel", 2211 | "_view_count": null, 2212 | "_view_module": "@jupyter-widgets/base", 2213 | "_view_module_version": "1.2.0", 2214 | "_view_name": "LayoutView", 2215 | "align_content": null, 2216 | "align_items": null, 2217 | "align_self": null, 2218 | "border": null, 2219 | "bottom": null, 2220 | "display": null, 2221 | "flex": null, 2222 | "flex_flow": null, 2223 | "grid_area": null, 2224 | "grid_auto_columns": null, 2225 | "grid_auto_flow": null, 2226 | "grid_auto_rows": null, 2227 | "grid_column": null, 2228 | "grid_gap": null, 2229 | "grid_row": null, 2230 | "grid_template_areas": null, 2231 | "grid_template_columns": null, 2232 | "grid_template_rows": null, 2233 | "height": null, 2234 | "justify_content": null, 2235 | "justify_items": null, 2236 | "left": null, 2237 | "margin": null, 2238 | "max_height": null, 2239 | "max_width": null, 2240 | "min_height": null, 2241 | "min_width": null, 2242 | "object_fit": null, 2243 | "object_position": null, 2244 | "order": null, 2245 | "overflow": null, 2246 | "overflow_x": null, 2247 | "overflow_y": null, 2248 | "padding": null, 2249 | "right": null, 2250 | "top": null, 2251 | "visibility": null, 2252 | "width": null 2253 | } 2254 | }, 2255 | "c084da4740a84edca925f547952b5c73": { 2256 | "model_module": "@jupyter-widgets/controls", 2257 | "model_module_version": "1.5.0", 2258 | "model_name": "DescriptionStyleModel", 2259 | "state": { 2260 | "_model_module": "@jupyter-widgets/controls", 2261 | "_model_module_version": "1.5.0", 2262 | "_model_name": "DescriptionStyleModel", 2263 | "_view_count": null, 2264 | "_view_module": "@jupyter-widgets/base", 2265 | "_view_module_version": "1.2.0", 2266 | "_view_name": "StyleView", 2267 | "description_width": "" 2268 | } 2269 | }, 2270 | "c5ad154d6092483588ab43d0a1ff2ff0": { 2271 | "model_module": "@jupyter-widgets/base", 2272 | "model_module_version": "1.2.0", 2273 | "model_name": "LayoutModel", 2274 | "state": { 2275 | "_model_module": "@jupyter-widgets/base", 2276 | "_model_module_version": "1.2.0", 2277 | "_model_name": "LayoutModel", 2278 | "_view_count": null, 2279 | "_view_module": "@jupyter-widgets/base", 2280 | "_view_module_version": "1.2.0", 2281 | "_view_name": "LayoutView", 2282 | "align_content": null, 2283 | "align_items": null, 2284 | "align_self": null, 2285 | "border": null, 2286 | "bottom": null, 2287 | "display": null, 2288 | "flex": null, 2289 | "flex_flow": null, 2290 | "grid_area": null, 2291 | "grid_auto_columns": null, 2292 | "grid_auto_flow": null, 2293 | "grid_auto_rows": null, 2294 | "grid_column": null, 2295 | "grid_gap": null, 2296 | "grid_row": null, 2297 | "grid_template_areas": null, 2298 | "grid_template_columns": null, 2299 | "grid_template_rows": null, 2300 | "height": null, 2301 | "justify_content": null, 2302 | "justify_items": null, 2303 | "left": null, 2304 | "margin": null, 2305 | "max_height": null, 2306 | "max_width": null, 2307 | "min_height": null, 2308 | "min_width": null, 2309 | "object_fit": null, 2310 | "object_position": null, 2311 | "order": null, 2312 | "overflow": null, 2313 | "overflow_x": null, 2314 | "overflow_y": null, 2315 | "padding": null, 2316 | "right": null, 2317 | "top": null, 2318 | "visibility": null, 2319 | "width": null 2320 | } 2321 | }, 2322 | "cdd149cb7f374c7882336633490652a8": { 2323 | "model_module": "@jupyter-widgets/controls", 2324 | "model_module_version": "1.5.0", 2325 | "model_name": "ProgressStyleModel", 2326 | "state": { 2327 | "_model_module": "@jupyter-widgets/controls", 2328 | "_model_module_version": "1.5.0", 2329 | "_model_name": "ProgressStyleModel", 2330 | "_view_count": null, 2331 | "_view_module": "@jupyter-widgets/base", 2332 | "_view_module_version": "1.2.0", 2333 | "_view_name": "StyleView", 2334 | "bar_color": null, 2335 | "description_width": "" 2336 | } 2337 | }, 2338 | "d5aea3fe6d48494f813a5e30127c45a7": { 2339 | "model_module": "@jupyter-widgets/controls", 2340 | "model_module_version": "1.5.0", 2341 | "model_name": "DescriptionStyleModel", 2342 | "state": { 2343 | "_model_module": "@jupyter-widgets/controls", 2344 | "_model_module_version": "1.5.0", 2345 | "_model_name": "DescriptionStyleModel", 2346 | "_view_count": null, 2347 | "_view_module": "@jupyter-widgets/base", 2348 | "_view_module_version": "1.2.0", 2349 | "_view_name": "StyleView", 2350 | "description_width": "" 2351 | } 2352 | }, 2353 | "d6d8f38e1c8a4cb1a0872ecff965dbfa": { 2354 | "model_module": "@jupyter-widgets/base", 2355 | "model_module_version": "1.2.0", 2356 | "model_name": "LayoutModel", 2357 | "state": { 2358 | "_model_module": "@jupyter-widgets/base", 2359 | "_model_module_version": "1.2.0", 2360 | "_model_name": "LayoutModel", 2361 | "_view_count": null, 2362 | "_view_module": "@jupyter-widgets/base", 2363 | "_view_module_version": "1.2.0", 2364 | "_view_name": "LayoutView", 2365 | "align_content": null, 2366 | "align_items": null, 2367 | "align_self": null, 2368 | "border": null, 2369 | "bottom": null, 2370 | "display": null, 2371 | "flex": null, 2372 | "flex_flow": null, 2373 | "grid_area": null, 2374 | "grid_auto_columns": null, 2375 | "grid_auto_flow": null, 2376 | "grid_auto_rows": null, 2377 | "grid_column": null, 2378 | "grid_gap": null, 2379 | "grid_row": null, 2380 | "grid_template_areas": null, 2381 | "grid_template_columns": null, 2382 | "grid_template_rows": null, 2383 | "height": null, 2384 | "justify_content": null, 2385 | "justify_items": null, 2386 | "left": null, 2387 | "margin": null, 2388 | "max_height": null, 2389 | "max_width": null, 2390 | "min_height": null, 2391 | "min_width": null, 2392 | "object_fit": null, 2393 | "object_position": null, 2394 | "order": null, 2395 | "overflow": null, 2396 | "overflow_x": null, 2397 | "overflow_y": null, 2398 | "padding": null, 2399 | "right": null, 2400 | "top": null, 2401 | "visibility": null, 2402 | "width": null 2403 | } 2404 | }, 2405 | "d7fd21f5a06441b887f6d7efcf427512": { 2406 | "model_module": "@jupyter-widgets/controls", 2407 | "model_module_version": "1.5.0", 2408 | "model_name": "ProgressStyleModel", 2409 | "state": { 2410 | "_model_module": "@jupyter-widgets/controls", 2411 | "_model_module_version": "1.5.0", 2412 | "_model_name": "ProgressStyleModel", 2413 | "_view_count": null, 2414 | "_view_module": "@jupyter-widgets/base", 2415 | "_view_module_version": "1.2.0", 2416 | "_view_name": "StyleView", 2417 | "bar_color": null, 2418 | "description_width": "" 2419 | } 2420 | }, 2421 | "db242277b75843f3bd4f4f8947bb579a": { 2422 | "model_module": "@jupyter-widgets/controls", 2423 | "model_module_version": "1.5.0", 2424 | "model_name": "DescriptionStyleModel", 2425 | "state": { 2426 | "_model_module": "@jupyter-widgets/controls", 2427 | "_model_module_version": "1.5.0", 2428 | "_model_name": "DescriptionStyleModel", 2429 | "_view_count": null, 2430 | "_view_module": "@jupyter-widgets/base", 2431 | "_view_module_version": "1.2.0", 2432 | "_view_name": "StyleView", 2433 | "description_width": "" 2434 | } 2435 | }, 2436 | "e438848f9acd4445ad9b4467be3559c5": { 2437 | "model_module": "@jupyter-widgets/controls", 2438 | "model_module_version": "1.5.0", 2439 | "model_name": "DescriptionStyleModel", 2440 | "state": { 2441 | "_model_module": "@jupyter-widgets/controls", 2442 | "_model_module_version": "1.5.0", 2443 | "_model_name": "DescriptionStyleModel", 2444 | "_view_count": null, 2445 | "_view_module": "@jupyter-widgets/base", 2446 | "_view_module_version": "1.2.0", 2447 | "_view_name": "StyleView", 2448 | "description_width": "" 2449 | } 2450 | }, 2451 | "e508023919f5417593e67ab195f1e282": { 2452 | "model_module": "@jupyter-widgets/controls", 2453 | "model_module_version": "1.5.0", 2454 | "model_name": "HBoxModel", 2455 | "state": { 2456 | "_dom_classes": [], 2457 | "_model_module": "@jupyter-widgets/controls", 2458 | "_model_module_version": "1.5.0", 2459 | "_model_name": "HBoxModel", 2460 | "_view_count": null, 2461 | "_view_module": "@jupyter-widgets/controls", 2462 | "_view_module_version": "1.5.0", 2463 | "_view_name": "HBoxView", 2464 | "box_style": "", 2465 | "children": [ 2466 | "IPY_MODEL_83dae3f65be04079ba91f7af373ce8e3", 2467 | "IPY_MODEL_31a6e30fda2b46dca7f97151cd7f9a66", 2468 | "IPY_MODEL_bcfaa671f66e4f778e16e76f98f6f734" 2469 | ], 2470 | "layout": "IPY_MODEL_ae92da64d84345cdaabf8c26693c42bd" 2471 | } 2472 | }, 2473 | "eb19d381c4784e5f84c4303c113b09bf": { 2474 | "model_module": "@jupyter-widgets/base", 2475 | "model_module_version": "1.2.0", 2476 | "model_name": "LayoutModel", 2477 | "state": { 2478 | "_model_module": "@jupyter-widgets/base", 2479 | "_model_module_version": "1.2.0", 2480 | "_model_name": "LayoutModel", 2481 | "_view_count": null, 2482 | "_view_module": "@jupyter-widgets/base", 2483 | "_view_module_version": "1.2.0", 2484 | "_view_name": "LayoutView", 2485 | "align_content": null, 2486 | "align_items": null, 2487 | "align_self": null, 2488 | "border": null, 2489 | "bottom": null, 2490 | "display": null, 2491 | "flex": null, 2492 | "flex_flow": null, 2493 | "grid_area": null, 2494 | "grid_auto_columns": null, 2495 | "grid_auto_flow": null, 2496 | "grid_auto_rows": null, 2497 | "grid_column": null, 2498 | "grid_gap": null, 2499 | "grid_row": null, 2500 | "grid_template_areas": null, 2501 | "grid_template_columns": null, 2502 | "grid_template_rows": null, 2503 | "height": null, 2504 | "justify_content": null, 2505 | "justify_items": null, 2506 | "left": null, 2507 | "margin": null, 2508 | "max_height": null, 2509 | "max_width": null, 2510 | "min_height": null, 2511 | "min_width": null, 2512 | "object_fit": null, 2513 | "object_position": null, 2514 | "order": null, 2515 | "overflow": null, 2516 | "overflow_x": null, 2517 | "overflow_y": null, 2518 | "padding": null, 2519 | "right": null, 2520 | "top": null, 2521 | "visibility": null, 2522 | "width": null 2523 | } 2524 | }, 2525 | "ec9f2566def44a21adc910def93c5714": { 2526 | "model_module": "@jupyter-widgets/base", 2527 | "model_module_version": "1.2.0", 2528 | "model_name": "LayoutModel", 2529 | "state": { 2530 | "_model_module": "@jupyter-widgets/base", 2531 | "_model_module_version": "1.2.0", 2532 | "_model_name": "LayoutModel", 2533 | "_view_count": null, 2534 | "_view_module": "@jupyter-widgets/base", 2535 | "_view_module_version": "1.2.0", 2536 | "_view_name": "LayoutView", 2537 | "align_content": null, 2538 | "align_items": null, 2539 | "align_self": null, 2540 | "border": null, 2541 | "bottom": null, 2542 | "display": null, 2543 | "flex": null, 2544 | "flex_flow": null, 2545 | "grid_area": null, 2546 | "grid_auto_columns": null, 2547 | "grid_auto_flow": null, 2548 | "grid_auto_rows": null, 2549 | "grid_column": null, 2550 | "grid_gap": null, 2551 | "grid_row": null, 2552 | "grid_template_areas": null, 2553 | "grid_template_columns": null, 2554 | "grid_template_rows": null, 2555 | "height": null, 2556 | "justify_content": null, 2557 | "justify_items": null, 2558 | "left": null, 2559 | "margin": null, 2560 | "max_height": null, 2561 | "max_width": null, 2562 | "min_height": null, 2563 | "min_width": null, 2564 | "object_fit": null, 2565 | "object_position": null, 2566 | "order": null, 2567 | "overflow": null, 2568 | "overflow_x": null, 2569 | "overflow_y": null, 2570 | "padding": null, 2571 | "right": null, 2572 | "top": null, 2573 | "visibility": null, 2574 | "width": null 2575 | } 2576 | }, 2577 | "edaf92da62ab445d93d628f8f3fa659d": { 2578 | "model_module": "@jupyter-widgets/base", 2579 | "model_module_version": "1.2.0", 2580 | "model_name": "LayoutModel", 2581 | "state": { 2582 | "_model_module": "@jupyter-widgets/base", 2583 | "_model_module_version": "1.2.0", 2584 | "_model_name": "LayoutModel", 2585 | "_view_count": null, 2586 | "_view_module": "@jupyter-widgets/base", 2587 | "_view_module_version": "1.2.0", 2588 | "_view_name": "LayoutView", 2589 | "align_content": null, 2590 | "align_items": null, 2591 | "align_self": null, 2592 | "border": null, 2593 | "bottom": null, 2594 | "display": null, 2595 | "flex": null, 2596 | "flex_flow": null, 2597 | "grid_area": null, 2598 | "grid_auto_columns": null, 2599 | "grid_auto_flow": null, 2600 | "grid_auto_rows": null, 2601 | "grid_column": null, 2602 | "grid_gap": null, 2603 | "grid_row": null, 2604 | "grid_template_areas": null, 2605 | "grid_template_columns": null, 2606 | "grid_template_rows": null, 2607 | "height": null, 2608 | "justify_content": null, 2609 | "justify_items": null, 2610 | "left": null, 2611 | "margin": null, 2612 | "max_height": null, 2613 | "max_width": null, 2614 | "min_height": null, 2615 | "min_width": null, 2616 | "object_fit": null, 2617 | "object_position": null, 2618 | "order": null, 2619 | "overflow": null, 2620 | "overflow_x": null, 2621 | "overflow_y": null, 2622 | "padding": null, 2623 | "right": null, 2624 | "top": null, 2625 | "visibility": null, 2626 | "width": null 2627 | } 2628 | }, 2629 | "edc378b51e184e5bac6f28044c968613": { 2630 | "model_module": "@jupyter-widgets/controls", 2631 | "model_module_version": "1.5.0", 2632 | "model_name": "HBoxModel", 2633 | "state": { 2634 | "_dom_classes": [], 2635 | "_model_module": "@jupyter-widgets/controls", 2636 | "_model_module_version": "1.5.0", 2637 | "_model_name": "HBoxModel", 2638 | "_view_count": null, 2639 | "_view_module": "@jupyter-widgets/controls", 2640 | "_view_module_version": "1.5.0", 2641 | "_view_name": "HBoxView", 2642 | "box_style": "", 2643 | "children": [ 2644 | "IPY_MODEL_fec3b79e4a494472aee9660954d391f2", 2645 | "IPY_MODEL_a0d1bcd896c447d088510d4ad58b6819", 2646 | "IPY_MODEL_94ed621363294d03ba922bdeb3d2d9ca" 2647 | ], 2648 | "layout": "IPY_MODEL_ba9731a6d757403d92f92e9dbe39e432" 2649 | } 2650 | }, 2651 | "f463bbf22a8d48528a56870357d05d1c": { 2652 | "model_module": "@jupyter-widgets/base", 2653 | "model_module_version": "1.2.0", 2654 | "model_name": "LayoutModel", 2655 | "state": { 2656 | "_model_module": "@jupyter-widgets/base", 2657 | "_model_module_version": "1.2.0", 2658 | "_model_name": "LayoutModel", 2659 | "_view_count": null, 2660 | "_view_module": "@jupyter-widgets/base", 2661 | "_view_module_version": "1.2.0", 2662 | "_view_name": "LayoutView", 2663 | "align_content": null, 2664 | "align_items": null, 2665 | "align_self": null, 2666 | "border": null, 2667 | "bottom": null, 2668 | "display": null, 2669 | "flex": null, 2670 | "flex_flow": null, 2671 | "grid_area": null, 2672 | "grid_auto_columns": null, 2673 | "grid_auto_flow": null, 2674 | "grid_auto_rows": null, 2675 | "grid_column": null, 2676 | "grid_gap": null, 2677 | "grid_row": null, 2678 | "grid_template_areas": null, 2679 | "grid_template_columns": null, 2680 | "grid_template_rows": null, 2681 | "height": null, 2682 | "justify_content": null, 2683 | "justify_items": null, 2684 | "left": null, 2685 | "margin": null, 2686 | "max_height": null, 2687 | "max_width": null, 2688 | "min_height": null, 2689 | "min_width": null, 2690 | "object_fit": null, 2691 | "object_position": null, 2692 | "order": null, 2693 | "overflow": null, 2694 | "overflow_x": null, 2695 | "overflow_y": null, 2696 | "padding": null, 2697 | "right": null, 2698 | "top": null, 2699 | "visibility": null, 2700 | "width": null 2701 | } 2702 | }, 2703 | "f903db4f00184e97b812857ce3506c62": { 2704 | "model_module": "@jupyter-widgets/base", 2705 | "model_module_version": "1.2.0", 2706 | "model_name": "LayoutModel", 2707 | "state": { 2708 | "_model_module": "@jupyter-widgets/base", 2709 | "_model_module_version": "1.2.0", 2710 | "_model_name": "LayoutModel", 2711 | "_view_count": null, 2712 | "_view_module": "@jupyter-widgets/base", 2713 | "_view_module_version": "1.2.0", 2714 | "_view_name": "LayoutView", 2715 | "align_content": null, 2716 | "align_items": null, 2717 | "align_self": null, 2718 | "border": null, 2719 | "bottom": null, 2720 | "display": null, 2721 | "flex": null, 2722 | "flex_flow": null, 2723 | "grid_area": null, 2724 | "grid_auto_columns": null, 2725 | "grid_auto_flow": null, 2726 | "grid_auto_rows": null, 2727 | "grid_column": null, 2728 | "grid_gap": null, 2729 | "grid_row": null, 2730 | "grid_template_areas": null, 2731 | "grid_template_columns": null, 2732 | "grid_template_rows": null, 2733 | "height": null, 2734 | "justify_content": null, 2735 | "justify_items": null, 2736 | "left": null, 2737 | "margin": null, 2738 | "max_height": null, 2739 | "max_width": null, 2740 | "min_height": null, 2741 | "min_width": null, 2742 | "object_fit": null, 2743 | "object_position": null, 2744 | "order": null, 2745 | "overflow": null, 2746 | "overflow_x": null, 2747 | "overflow_y": null, 2748 | "padding": null, 2749 | "right": null, 2750 | "top": null, 2751 | "visibility": null, 2752 | "width": null 2753 | } 2754 | }, 2755 | "fb898a36c26845b49147b3d9c143ed12": { 2756 | "model_module": "@jupyter-widgets/controls", 2757 | "model_module_version": "1.5.0", 2758 | "model_name": "FloatProgressModel", 2759 | "state": { 2760 | "_dom_classes": [], 2761 | "_model_module": "@jupyter-widgets/controls", 2762 | "_model_module_version": "1.5.0", 2763 | "_model_name": "FloatProgressModel", 2764 | "_view_count": null, 2765 | "_view_module": "@jupyter-widgets/controls", 2766 | "_view_module_version": "1.5.0", 2767 | "_view_name": "ProgressView", 2768 | "bar_style": "success", 2769 | "description": "", 2770 | "description_tooltip": null, 2771 | "layout": "IPY_MODEL_45d3b0c6c5024804a90cbbc2ba936443", 2772 | "max": 1042301, 2773 | "min": 0, 2774 | "orientation": "horizontal", 2775 | "style": "IPY_MODEL_30f7666533ca4a67b4690640655338d8", 2776 | "value": 1042301 2777 | } 2778 | }, 2779 | "fd234cc407754bd2855d827a04efec41": { 2780 | "model_module": "@jupyter-widgets/base", 2781 | "model_module_version": "1.2.0", 2782 | "model_name": "LayoutModel", 2783 | "state": { 2784 | "_model_module": "@jupyter-widgets/base", 2785 | "_model_module_version": "1.2.0", 2786 | "_model_name": "LayoutModel", 2787 | "_view_count": null, 2788 | "_view_module": "@jupyter-widgets/base", 2789 | "_view_module_version": "1.2.0", 2790 | "_view_name": "LayoutView", 2791 | "align_content": null, 2792 | "align_items": null, 2793 | "align_self": null, 2794 | "border": null, 2795 | "bottom": null, 2796 | "display": null, 2797 | "flex": null, 2798 | "flex_flow": null, 2799 | "grid_area": null, 2800 | "grid_auto_columns": null, 2801 | "grid_auto_flow": null, 2802 | "grid_auto_rows": null, 2803 | "grid_column": null, 2804 | "grid_gap": null, 2805 | "grid_row": null, 2806 | "grid_template_areas": null, 2807 | "grid_template_columns": null, 2808 | "grid_template_rows": null, 2809 | "height": null, 2810 | "justify_content": null, 2811 | "justify_items": null, 2812 | "left": null, 2813 | "margin": null, 2814 | "max_height": null, 2815 | "max_width": null, 2816 | "min_height": null, 2817 | "min_width": null, 2818 | "object_fit": null, 2819 | "object_position": null, 2820 | "order": null, 2821 | "overflow": null, 2822 | "overflow_x": null, 2823 | "overflow_y": null, 2824 | "padding": null, 2825 | "right": null, 2826 | "top": null, 2827 | "visibility": null, 2828 | "width": null 2829 | } 2830 | }, 2831 | "fec3b79e4a494472aee9660954d391f2": { 2832 | "model_module": "@jupyter-widgets/controls", 2833 | "model_module_version": "1.5.0", 2834 | "model_name": "HTMLModel", 2835 | "state": { 2836 | "_dom_classes": [], 2837 | "_model_module": "@jupyter-widgets/controls", 2838 | "_model_module_version": "1.5.0", 2839 | "_model_name": "HTMLModel", 2840 | "_view_count": null, 2841 | "_view_module": "@jupyter-widgets/controls", 2842 | "_view_module_version": "1.5.0", 2843 | "_view_name": "HTMLView", 2844 | "description": "", 2845 | "description_tooltip": null, 2846 | "layout": "IPY_MODEL_496f405fdfcd478a8827bfcc09e688ff", 2847 | "placeholder": "​", 2848 | "style": "IPY_MODEL_5388285aaf484406a49580d52c753ffd", 2849 | "value": "config.json: 100%" 2850 | } 2851 | } 2852 | } 2853 | } 2854 | }, 2855 | "nbformat": 4, 2856 | "nbformat_minor": 4 2857 | } 2858 | --------------------------------------------------------------------------------