Update README.md
Browse files
README.md
CHANGED
@@ -1,5 +1,51 @@
|
|
1 |
-
---
|
2 |
-
license: apache-2.0
|
3 |
-
tags:
|
4 |
-
- unsloth
|
5 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: apache-2.0
|
3 |
+
tags:
|
4 |
+
- unsloth
|
5 |
+
- trl
|
6 |
+
- sft
|
7 |
+
datasets:
|
8 |
+
- billa-man/llm-prompt-recovery
|
9 |
+
language:
|
10 |
+
- en
|
11 |
+
base_model:
|
12 |
+
- unsloth/Llama-3.2-3B-Instruct
|
13 |
+
pipeline_tag: text2text-generation
|
14 |
+
library_name: transformers
|
15 |
+
---
|
16 |
+
|
17 |
+
Model that I used for this Kaggle Competition: [LLM Prompt Recovery](https://www.kaggle.com/competitions/llm-prompt-recovery)
|
18 |
+
|
19 |
+
My Kaggle implementation: [Notebook](https://www.kaggle.com/code/sohithbandari/llama-3-2-3b-llm-prompt-recovery)
|
20 |
+
|
21 |
+
## Usage:
|
22 |
+
```
|
23 |
+
from unsloth import FastLanguageModel
|
24 |
+
from peft import PeftModel
|
25 |
+
|
26 |
+
model, tokenizer = FastLanguageModel.from_pretrained(
|
27 |
+
model_name = "unsloth/Llama-3.2-3B-Instruct",
|
28 |
+
max_seq_length = 512,
|
29 |
+
dtype = None,
|
30 |
+
load_in_4bit = True,
|
31 |
+
)
|
32 |
+
|
33 |
+
model = PeftModel.from_pretrained(model, "billa-man/llm-prompt-recovery")
|
34 |
+
```
|
35 |
+
|
36 |
+
## Input to the LLM is in the following format:
|
37 |
+
|
38 |
+
```
|
39 |
+
{"role": "user", "content": "Return the prompt that was used to tranform the original text into the rewritten text. Original Text: " + original_text +", Rewritten Text: " + rewritten_text}
|
40 |
+
```
|
41 |
+
|
42 |
+
## An example:
|
43 |
+
```
|
44 |
+
original_text = "Recent breakthroughs have demonstrated several ways to induce magnetism in materials using light, with significant implications for future computing and data storage technologies."
|
45 |
+
rewritten_text = "Light-induced magnetic phase transitions in non-magnetic materials have been experimentally demonstrated through ultrafast optical excitation, offering promising pathways for photomagnetic control in next-generation spintronic devices and quantum computing architectures."
|
46 |
+
|
47 |
+
inference(original_text, rewritten_text) (check notebook for code)
|
48 |
+
```
|
49 |
+
```
|
50 |
+
(output) 'Rewrite the following sentence while maintaining its original meaning but using different wording and terminology: "Recent breakthroughs have demonstrated several ways to induce magnetism in materials using light, with significant implications for future computing and data storage technologies."'
|
51 |
+
```
|