anjohn0077 commited on
Commit
6536425
·
verified ·
1 Parent(s): 2b1d5c2

Update README for sanitized vLLM-ready toxicity adapter

Browse files
Files changed (1) hide show
  1. README.md +43 -14
README.md CHANGED
@@ -6,23 +6,52 @@ library_name: peft
6
  tags:
7
  - mergekit
8
  - peft
9
-
 
10
  ---
11
- # toxicity
12
-
13
- This is a LoRA extracted from a language model. It was extracted using [mergekit](https://github.com/arcee-ai/mergekit).
14
-
15
- ## LoRA Details
16
-
17
- This LoRA adapter was extracted from [K-intelligence/Llama-SafetyGuard-Content-Binary](https://huggingface.co/K-intelligence/Llama-SafetyGuard-Content-Binary) and uses [meta-llama/Llama-3.1-8B](https://huggingface.co/meta-llama/Llama-3.1-8B) as a base.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
18
 
19
- [!WARNING]
20
- > The vocabulary size has been extended from the base model's 128256 to 128258. To load this adapter, you must first call `model.resize_token_embeddings(128258)`.
21
 
22
- ### Parameters
 
 
 
 
23
 
24
- The following command was used to extract this LoRA adapter:
 
25
 
26
- ```sh
27
- /nethome/ian6/ian6-myenv/bin/mergekit-extract-lora --model K-intelligence/Llama-SafetyGuard-Content-Binary --base-model meta-llama/Llama-3.1-8B --out-path ./lora_adapters/toxicity --cuda
 
 
 
28
  ```
 
6
  tags:
7
  - mergekit
8
  - peft
9
+ - lora
10
+ - vllm
11
  ---
12
+ # NEXS toxicity LoRA (vLLM-ready)
13
+
14
+ Rank-128 LoRA adapter for the **toxicity** domain, extracted with
15
+ [mergekit](https://github.com/arcee-ai/mergekit) from
16
+ [K-intelligence/Llama-SafetyGuard-Content-Binary](https://huggingface.co/K-intelligence/Llama-SafetyGuard-Content-Binary) against the base model
17
+ [meta-llama/Llama-3.1-8B](https://huggingface.co/meta-llama/Llama-3.1-8B), then sanitized for vLLM
18
+ serving.
19
+
20
+ ## Sanitization applied
21
+
22
+ The raw mergekit extraction included full-rank `modules_to_save` tensors
23
+ (`embed_tokens`, `lm_head`, and RMSNorm layers) that vLLM's LoRA runtime does
24
+ not support. This upload contains only the pure low-rank `lora_A`/`lora_B`
25
+ weights (224 pairs: 32 layers x q/k/v/o/gate/up/down projections, bf16), with
26
+ `modules_to_save: null` in `adapter_config.json`. No `resize_token_embeddings()`
27
+ call is needed to load this adapter.
28
+
29
+ ## Serving with vLLM
30
+
31
+ ```bash
32
+ python -m vllm.entrypoints.openai.api_server \
33
+ --model meta-llama/Llama-3.1-8B \
34
+ --enable-lora \
35
+ --lora-modules toxicity=anjohn0077/NEXS-toxicity-lora \
36
+ --port 8000 \
37
+ --max-lora-rank 128 \
38
+ --gpu-memory-utilization 0.85
39
+ ```
40
 
41
+ ## Evaluation (sst2)
 
42
 
43
+ | Variant | Accuracy |
44
+ |---|---|
45
+ | Base model | 0.6732 |
46
+ | **This LoRA on base (via vLLM)** | **0.8991** |
47
+ | Original full fine-tune | 0.8899 |
48
 
49
+ Evaluated with [lm-evaluation-harness](https://github.com/EleutherAI/lm-evaluation-harness)
50
+ against a local vLLM OpenAI-compatible endpoint:
51
 
52
+ ```bash
53
+ lm_eval --model local-completions \
54
+ --model_args model=toxicity,base_url=http://localhost:8000/v1/completions,tokenizer=meta-llama/Llama-3.1-8B,num_concurrent=10 \
55
+ --tasks sst2 \
56
+ --output_path results/vllm_toxicity
57
  ```