--- base_model: meta-llama/Llama-3.2-11B-Vision-Instruct language: - en library_name: peft license: apache-2.0 pipeline_tag: text-generation --- # Model Details This model is a fine-tuned version of base model [meta-llama/Llama-3.2-11B-Vision-Instruct](https://huggingface.co/meta-llama/Llama-3.2-11B-Vision-Instruct) using LoRA on the [train_qa_wo_students.csv](https://drive.google.com/file/d/1uv-kVP0z3E8u9-u8PWAKA9tkr3ENHeZv/view?usp=sharing) dataset combing materials from FEM courses of [Prof. Krishna Garikipati](https://viterbi.usc.edu/directory/faculty/Garikipati/Krishna). Compared with [TOMMI-0.35](https://huggingface.co/my-ai-university/TOMMI-0.35/), TOMMI-1.0 uses the optimal hyperparameters (without student asked QA pairs) and increased token length of 700 from 500. ## **Paper** * [arXiv](https://arxiv.org/abs/2504.08846) ## **Project page** * https://my-ai-university.com ## **Github** * https://github.com/my-ai-university/finite-element-method ## **Hyperparameters** * learning_rate: 5e-5 * gradient_accumulation_steps: 2 * epoch: 5 * r (lora rank): 45 * lora_alpha: 65 * lora_dropout: 0.05 * target_modules: ["q_proj", "k_proj", "v_proj", "o_proj", "gate_proj", "up_proj", "down_proj"] ## **Usage** **For Expanse usage, you should request at least two V100s to run the following code.** ### **Env Setup** ```bash #!/bin/bash # python 3.10 + cuda 11.8.0 export MKL_NUM_THREADS=1 export NUMEXPR_NUM_THREADS=1 export OPENBLAS_NUM_THREADS=1 export OMP_NUM_THREADS=1 conda clean -a -y # conda for traditional and reliable setup mamba clean -a -y # mamba for smart and efficient setup pip install --upgrade pip # cuda, gcc/g++, torch conda install cuda -c nvidia/label/cuda-11.8.0 -y pip install torch==2.5.1 torchvision==0.20.1 torchaudio==2.5.1 --index-url https://download.pytorch.org/whl/cu118 pip install torchao==0.7.0 --index-url https://download.pytorch.org/whl/cu118 # deepspeed mamba install gcc gxx -c conda-forge -y # ensure > 9.0 for ninja JIT pip install deepspeed==0.15.4 # bitsandbytes pip install setuptools mamba install bitsandbytes=0.45.0 -c conda-forge --no-deps -y pip install psutil # add the following to your .bashrc or running scripts #export BNB_CUDA_VERSION=118 #export CUDA_HOME=$CONDA_PREFIX #export LD_LIBRARY_PATH="$CONDA_PREFIX/lib:$LD_LIBRARY_PATH" # trl, accelerate, peft pip install trl pip install accelerate peft optuna optuna_integration datasets # other dependencies pip install scikit-learn pexpect pip install wandb plotly # takes a while ``` ### **Example Code** ```python from peft import PeftModel import time import torch from transformers import PreTrainedTokenizerFast, AutoModelForCausalLM # ... (rest of the example code) ```