File size: 1,820 Bytes
428eda2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
---
license: llama3
language:
- en
base_model: meta-llama/Meta-Llama-3-8B-Instruct
tags:
- large language models
- speech-language models
- speech interaction
- speech-to-speech
library_name: Auto-RAG
---

# Auto-RAG: Autonomous Retrieval-Augmented Generation for Large Language models

> [Tian Yu](https://tianyu0313.github.io/), [Shaolei Zhang](https://zhangshaolei1998.github.io/), and [Yang Feng](https://people.ucas.edu.cn/~yangfeng?language=en)*


## Model Details

<!-- Provide a longer summary of what this model is. -->


- **Discription:**
- **Developed by:** ICTNLP Group. Authors: Tian Yu, Shaolei Zhang and Yang Feng.
- **Github Repository:** https://github.com/ictnlp/Auto-RAG
- **Finetuned from model:** Meta-Llama3-8B-Instruct


## Uses

<!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->

Merge the Meta-Llama3-8B-Instruct weights and Adapter weights.

```
import os
from transformers import AutoTokenizer, LlamaForCausalLM
import torch

model = LlamaForCausalLM.from_pretrained(PATH_TO_META_LLAMA3_8B_INSTRUCT,
                                  device_map="cpu", 
                                  )
from peft import PeftModel

model = PeftModel.from_pretrained(model, 
                                  PATH_TO_ADAPTER)

from transformers import AutoTokenizer
tokenizer = AutoTokenizer.from_pretrained(PATH_TO_META_LLAMA3_8B_INSTRUCT)

model = model.merge_and_unload()
model.save_pretrained(SAVE_PATH)
tokenizer.save_pretrained(SAVE_PATH)
```

Subsequently, you can deploy using frameworks such as vllm.

## Citation [optional]

<!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->

**BibTeX:**

[More Information Needed]