Instructions to use anjohn0077/NEXS-toxicity-lora with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use anjohn0077/NEXS-toxicity-lora with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("meta-llama/Llama-3.1-8B") model = PeftModel.from_pretrained(base_model, "anjohn0077/NEXS-toxicity-lora") - Notebooks
- Google Colab
- Kaggle
Add toxicity LoRA adapter extracted from K-intelligence/Llama-SafetyGuard-Content-Binary (base: meta-llama/Llama-3.1-8B)
Browse files- README.md +28 -0
- adapter_config.json +29 -0
- adapter_model.safetensors +3 -0
README.md
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
base_model:
|
| 3 |
+
- meta-llama/Llama-3.1-8B
|
| 4 |
+
- K-intelligence/Llama-SafetyGuard-Content-Binary
|
| 5 |
+
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 |
+
```
|
adapter_config.json
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"base_model_name_or_path": "meta-llama/Llama-3.1-8B",
|
| 3 |
+
"peft_type": "LORA",
|
| 4 |
+
"use_rslora": false,
|
| 5 |
+
"target_modules": [
|
| 6 |
+
"gate_proj",
|
| 7 |
+
"o_proj",
|
| 8 |
+
"v_proj",
|
| 9 |
+
"q_proj",
|
| 10 |
+
"down_proj",
|
| 11 |
+
"up_proj",
|
| 12 |
+
"k_proj"
|
| 13 |
+
],
|
| 14 |
+
"modules_to_save": [
|
| 15 |
+
"embed_tokens",
|
| 16 |
+
"input_layernorm",
|
| 17 |
+
"post_attention_layernorm",
|
| 18 |
+
"norm",
|
| 19 |
+
"lm_head"
|
| 20 |
+
],
|
| 21 |
+
"task_type": "CAUSAL_LM",
|
| 22 |
+
"r": 128,
|
| 23 |
+
"lora_alpha": 128,
|
| 24 |
+
"rank_pattern": {},
|
| 25 |
+
"alpha_pattern": {},
|
| 26 |
+
"lora_dropout": 0.0,
|
| 27 |
+
"fan_in_fan_out": false,
|
| 28 |
+
"inference_mode": true
|
| 29 |
+
}
|
adapter_model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:1ab78deea0e6e48e2324577a8e620858b5ded72657a4cd8c778da01e3030ea8c
|
| 3 |
+
size 2773071512
|