Use of llm in various medical tasks
- using hugging face pipeline
- downloading weights directly from meta
- Sign up on hugging face
- Go to meta llama repositories
- complete the mandatory form, wait for approval
- install git lfs (sudo apt install git-lfs)
- now download llama repository from huggingface like one do for github
- Download and install miniconda from here:
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
bash ./Miniconda3-latest-Linux-x86_64.sh -b
~/miniconda3/bin/conda init
source ~/.bashrc
- make conda environment as mentioned below
conda create -n llm python=3.9
conda activate llm
conda install pytorch torchvision torchaudio pytorch-cuda=12.4 -c pytorch -c nvidia
pip install -r requirements.txt
One should always set up a llama server, so that flow of information is easy
- Run this script using screen so that a llama server is running in background. All the server script are contained in a folder: server_scripts
fastapi run server_3.1.py
- Now, a server url will be exposes that can be used as API like https://0.0.0.0:8000
- You can run your main script or a jupyter notebook
conda create -n llm
conda activate llm
pip install --extra-index-url https://download.pytorch.org/whl/test/cu118 llama-recipes
#now download weigths from llama: by going to https://llama.meta.com/llama-downloads/
#fill form
# recieve mail, visit https://github.com/meta-llama/llama
bash download.sh
# enter the link here you recieved in mail and then press enter to download all the models
bash convert_hf.sh
bash download_llama3.sh
(enter the url you recived on mail)
torchrun --nproc_per_node 1 example_chat_completion.py \
--ckpt_dir Meta-Llama-3-8B-Instruct/ \
--tokenizer_path Meta-Llama-3-8B-Instruct/tokenizer.model \
--max_seq_len 512 --max_batch_size 6
Sr No. | Experiment Name | Notebook link |
---|---|---|
1 | Classification of musculoskeletal fracture using vlm like llama 3.2, chatgpt, grok2 | ---- |
- Add server scripts for llama 3.1
- Add server scripts for llama 3.2
- Add M42 medical LLM expermient
- Create a benchmark dataset of report classification