Instructions to use SamahFodeh/EPPC-CARE-Qwen2.5-32B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use SamahFodeh/EPPC-CARE-Qwen2.5-32B with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("unsloth/Qwen2.5-32B-Instruct-bnb-4bit") model = PeftModel.from_pretrained(base_model, "SamahFodeh/EPPC-CARE-Qwen2.5-32B") - Notebooks
- Google Colab
- Kaggle
EPPC-CARE: Qwen2.5-32B
Distribution of our best reported EPPC-CARE model: the Qwen2.5-32B LoRA adapter and the code that runs its multistage annotation workflow. The package is approximately 527 MiB. Base-model weights are downloaded and cached automatically on first use.
Setup
Use Linux, Python 3.11 or 3.12, and NVIDIA CUDA GPUs. The 16-bit base model
requires approximately 65 GB for weights alone, plus inference and retrieval
memory. Use sufficient GPU capacity, such as a 96 GB GPU or multiple GPUs.
For an 80 GB GPU, --gpu-memory-utilization 0.9 --retrieval-device cpu may
be needed; the exact fit depends on the software stack and available memory.
This repository is public; no Hugging Face login is required to download it.
python -m venv .venv
source .venv/bin/activate
pip install huggingface_hub
hf download SamahFodeh/EPPC-CARE-Qwen2.5-32B --local-dir eppc-care
cd eppc-care
pip install -r requirements.txt
Retrieval data
The current runner requires the original 607 labeled training examples as
retrieval memory. Obtain eppc_train.jsonl through the group's existing data
sharing process; it is separate from this model repository. Preserve row order
when reproducing our reported evaluation. No test data is needed to annotate
new messages.
--retrieval-data accepts JSONL or a datasets.save_to_disk() directory. Each
training record needs string query and answer fields. answer contains JSON
with a results list of objects containing Code, Sub-code, and Span.
The runner checks JSONL against the original training-file checksum.
Annotate one message
python run.py \
--retrieval-data /path/to/eppc_train.jsonl \
--message "Thank you for explaining the next steps. When should I schedule the follow-up?" \
--to-patient N \
--output predictions.jsonl
Y means provider-to-patient; N means patient-to-provider.
The runner uses BGE to retrieve two labeled training examples, then applies the adapter through all three generation stages:
- Extract communication-intent spans.
- Refine spans and assign parent Codes.
- Assign a Sub-code to each span/Code pair using the valid child names.
The runner loads unsloth/Qwen2.5-32B-Instruct and attaches our adapter through
vLLM. No manual merge is needed. A plain transformers.pipeline() call does
not run the multistage controller.
Batch input and output
For batch inference, create a JSONL file with one object per line:
{"message": "Thank you for explaining the next steps.", "to_pat_yn": "N"}
{"message": "Please schedule a follow-up appointment next week.", "to_pat_yn": "Y"}
Then run:
python run.py \
--retrieval-data /path/to/eppc_train.jsonl \
--input messages.jsonl \
--output predictions_batch.jsonl
Original dataset records with query and optional answer fields are also
accepted, as are datasets.save_to_disk() directories. Queries must contain
TO_PAT_YN: Y or TO_PAT_YN: N.
Each output row contains query, stage1_out, stage2_out, and final_out.
final_out is a JSON string with the final results list. If the input includes
answer, the output also includes gold_answer. Existing output files are
not overwritten.
Useful options:
--tensor-parallel-size 2: spread the base model across two GPUs.--retrieval-device cpu: run the BGE retrieval model on CPU.--dry-run: validate local inputs without downloading models or using a GPU.--adapter: use another local adapter directory or a Hugging Face model ID.--base-revision/--adapter-revision: select explicit Hub revisions.--merged-model: use locally merged weights instead of runtime LoRA.
Run python run.py --help for the full argument list.
Evaluation
With the original labeled 260-case test file:
python run.py --retrieval-data /path/to/eppc_train.jsonl \
--input /path/to/eppc_test.jsonl --output predictions_test.jsonl
python score.py predictions_test.jsonl
| Metric | Reported micro-F1 |
|---|---|
| Relaxed Span | 86.083% |
| Relaxed Code+Span | 70.495% |
| Relaxed Sub-code+Span | 67.038% |
| Relaxed Triplet | 64.401% |
| Code only | 87.061% |
| Sub-code only | 80.508% |
| Code+Sub-code only | 77.332% |
These saved results used locally merged 16-bit weights and the original retrieval data. Runtime LoRA uses the same stage prompts and orchestration but may produce different numerical outputs. The supplied controller passed CPU checks, including prompt parity across all 260 cases; a fresh GPU evaluation of the runtime-LoRA path has not been performed.
score.py computes the four span-dependent endpoints. evaluation.json
contains the saved aggregate results. validation.json records packaging checks.
For the original merged-weight path, install requirements-train.txt in a
separate environment and run python merge.py --adapter . --output merged_model.
Then return to the vLLM environment and add --merged-model merged_model to
the inference command. eval_original.py is the unchanged original evaluator.
The repository contains no training or test message records. The examples
under examples/ are synthetic.
- Downloads last month
- -
Model tree for SamahFodeh/EPPC-CARE-Qwen2.5-32B
Base model
Qwen/Qwen2.5-32B