File size: 1,230 Bytes
a18b124
 
 
 
af8b800
a18b124
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
48a7bc2
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
---
base_model: meta-llama/Llama-3.1-8B-Instruct
library_name: peft
pipeline_tag: text-generation
license: llama3.1
tags:
  - lora
  - peft
  - transformers
  - soft-prompt
  - instruction-generation
---

# Soft-to-Hard Prompt Translator

LoRA adapter that translates soft prompt embeddings into natural-language
task instructions. Part of the "Learning to Translate from Soft to Hard
LLM Prompts" project.

## Usage

```python
from peft import PeftModel
from transformers import AutoModelForCausalLM, AutoTokenizer

base_model = AutoModelForCausalLM.from_pretrained(
    "meta-llama/Llama-3.1-8B-Instruct", torch_dtype="auto", device_map="auto",
)
model = PeftModel.from_pretrained(base_model, "<path-to-adapter>")
tokenizer = AutoTokenizer.from_pretrained("meta-llama/Llama-3.1-8B-Instruct")
```

## Training Details

| Parameter | Value |
|---|---|
| Base model | `meta-llama/Llama-3.1-8B-Instruct` |
| LoRA rank | 4 |
| LoRA alpha | 8 |
| Dropout | 0.1 |
| Target modules | down_proj, gate_proj, k_proj, up_proj, v_proj, o_proj, q_proj |
| PEFT version | 0.18.0 |

## License & Attribution

Built with Llama.

Llama 3.1 is licensed under the Llama 3.1 Community License, Copyright © Meta Platforms, Inc. All Rights Reserved.