Skip to content

About

Projects of generative model's that answers your questions

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

 

History

3 Commits

Folders and files

Repository files navigation

LoRA fine-tuning on medical terminology

This training experiment adapts a Llama causal language model to instruction-formatted text. It writes a PEFT adapter and tokenizer, then generates a sample using the trained adapter. The output is an experimental text completion for evaluating the training pipeline.

Run

Install the requirements in a Python 3.12 environment. For the default 4-bit run, use a CUDA-enabled PyTorch installation and install bitsandbytes.

python -m pip install -r requirements.txt
python -m pip install bitsandbytes
python "medical language model.py" --steps 100 --output results --prompt "Define a medical term."

The defaults load aboonaji/llama2finetune-v2 and the training split of aboonaji/wiki_medical_terms_llam2_format from Hugging Face. Access depends on the repositories and any applicable model terms. To use local data, supply a JSON Lines file with one text field per row.

For a CPU integration run, point --model at a small local Llama checkpoint and use --full-precision --jsonl sample.jsonl --steps 1 --batch-size 1. The adapter requires the same base checkpoint for later inference. A training smoke test verifies execution and serialization. Assess model quality separately on held-out prompts before drawing conclusions about its responses.

About

Projects of generative model's that answers your questions

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages