Upload folder using huggingface_hub
Browse files- README.md +25 -0
- adapter_config.json +34 -0
- adapter_model.safetensors +3 -0
README.md
ADDED
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
# qwen-rag-lora
|
3 |
+
|
4 |
+
This is a LoRA adapter trained on the Qwen model for RAG tasks.
|
5 |
+
|
6 |
+
## Model Details
|
7 |
+
- Base Model: Qwen/Qwen2.5-0.5B-Instruct
|
8 |
+
- Training Type: LoRA
|
9 |
+
- Task: RAG (Retrieval-Augmented Generation)
|
10 |
+
|
11 |
+
## Usage
|
12 |
+
|
13 |
+
```python
|
14 |
+
from peft import PeftModel, PeftConfig
|
15 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
16 |
+
|
17 |
+
# Load base model and tokenizer
|
18 |
+
model_name = "Qwen/Qwen2.5-0.5B-Instruct"
|
19 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name, trust_remote_code=True)
|
20 |
+
model = AutoModelForCausalLM.from_pretrained(model_name, trust_remote_code=True)
|
21 |
+
|
22 |
+
# Load LoRA weights
|
23 |
+
peft_model = PeftModel.from_pretrained(model, "TatvaJoshi-AHS/qwen-rag-lora")
|
24 |
+
```
|
25 |
+
|
adapter_config.json
ADDED
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"alpha_pattern": {},
|
3 |
+
"auto_mapping": null,
|
4 |
+
"base_model_name_or_path": "Qwen/Qwen2.5-0.5B-Instruct",
|
5 |
+
"bias": "none",
|
6 |
+
"eva_config": null,
|
7 |
+
"exclude_modules": null,
|
8 |
+
"fan_in_fan_out": false,
|
9 |
+
"inference_mode": true,
|
10 |
+
"init_lora_weights": true,
|
11 |
+
"layer_replication": null,
|
12 |
+
"layers_pattern": null,
|
13 |
+
"layers_to_transform": null,
|
14 |
+
"loftq_config": {},
|
15 |
+
"lora_alpha": 32,
|
16 |
+
"lora_bias": false,
|
17 |
+
"lora_dropout": 0.1,
|
18 |
+
"megatron_config": null,
|
19 |
+
"megatron_core": "megatron.core",
|
20 |
+
"modules_to_save": null,
|
21 |
+
"peft_type": "LORA",
|
22 |
+
"r": 8,
|
23 |
+
"rank_pattern": {},
|
24 |
+
"revision": null,
|
25 |
+
"target_modules": [
|
26 |
+
"o_proj",
|
27 |
+
"v_proj",
|
28 |
+
"q_proj",
|
29 |
+
"k_proj"
|
30 |
+
],
|
31 |
+
"task_type": "CAUSAL_LM",
|
32 |
+
"use_dora": false,
|
33 |
+
"use_rslora": false
|
34 |
+
}
|
adapter_model.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:c8319c082df20c37a20d8e30dd8dafabba359514d9e4d3bf4f5419b6f084b1fe
|
3 |
+
size 4350392
|