File size: 2,210 Bytes
ab3134e
2220ca6
 
 
 
 
 
 
 
 
 
 
 
ab3134e
 
2220ca6
06dfd69
2220ca6
ab3134e
2220ca6
ab3134e
41079c1
ab3134e
2220ca6
 
 
ab3134e
 
 
a78d58e
2220ca6
ab3134e
 
2220ca6
ab3134e
41079c1
 
 
 
ab3134e
41079c1
ab3134e
 
 
41079c1
2220ca6
ab3134e
a78d58e
ab3134e
2220ca6
ab3134e
2220ca6
ab3134e
2220ca6
ab3134e
2220ca6
ab3134e
 
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
---
license: openrail
language:
- fr
pipeline_tag: text-generation
library_name: transformers
tags:
- alpaca
- llama
- LLM
datasets:
- tatsu-lab/alpaca
inference: false
---

<p align="center" width="100%">
<img src="https://huggingface.co/bofenghuang/vigogne-lora-7b/resolve/main/vigogne_logo.png" alt="Vigogne" style="width: 40%; min-width: 300px; display: block; margin: auto;">
</p>

# Vigogne-LoRA-7b: A French Instruct LLaMA Model

Vigogne-LoRA-7b is a LLaMA-7B model fine-tuned on the translated [Stanford Alpaca](https://github.com/tatsu-lab/stanford_alpaca) dataset to follow the 🇫🇷 French instructions.

For more information, please visit the Github repo: https://github.com/bofenghuang/vigogne

**Usage and License Notices**: Same as [Stanford Alpaca](https://github.com/tatsu-lab/stanford_alpaca), Vigogne is intended and licensed for research use only. The dataset is CC BY NC 4.0 (allowing only non-commercial use) and models trained using the dataset should not be used outside of research purposes.

## Usage

This repo only contains the low-rank adapter. In order to access the complete model, you also need to load the base LLM model and tokenizer.

```python
from peft import PeftModel
from transformers import LlamaForCausalLM, LlamaTokenizer

base_model_name_or_path = "<name/or/path/to/hf/llama/7b/model>"
lora_model_name_or_path = "bofenghuang/vigogne-lora-7b"

tokenizer = LlamaTokenizer.from_pretrained(base_model_name_or_path)
model = LlamaForCausalLM.from_pretrained(
    base_model_name_or_path,
    load_in_8bit=True,
    device_map="auto",
)
model = PeftModel.from_pretrained(model, lora_model_name_or_path)
```

You can infer this model by using the following Google Colab Notebook.

<a href="https://colab.research.google.com/github/bofenghuang/vigogne/blob/main/infer.ipynb" target="_blank"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>

## Limitations

Vigogne is still under development, and there are many limitations that have to be addressed. Please note that it is possible that the model generates harmful or biased content, incorrect information or generally unhelpful answers.

## Next Steps

- Add output examples