PEFT
English
tomaarsen HF staff commited on
Commit
9f196d3
1 Parent(s): 5e91520

Create a model card

Browse files
Files changed (1) hide show
  1. README.md +67 -4
README.md CHANGED
@@ -1,10 +1,73 @@
1
  ---
2
  library_name: peft
 
 
 
 
 
 
3
  ---
4
- ## Training procedure
 
5
 
6
- ### Framework versions
7
 
8
- - PEFT 0.5.0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9
 
10
- - PEFT 0.5.0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
  library_name: peft
3
+ datasets:
4
+ - laion/OIG
5
+ - argilla/oig-30k
6
+ language:
7
+ - en
8
+ license: apache-2.0
9
  ---
10
+ # Model card for Mistral-7B-v0.1-chat-OIG
11
+ Mistral-7B-v0.1-chat-OIG is a LLM trained to act as a chat assistant, capable of subsequent prompting. It is finetuned from [mistralai/Mistral-7B-v0.1](https://huggingface.co/mistralai/Mistral-7B-v0.1) on 3k samples from the [laion/OIG](https://huggingface.co/datasets/laion/OIG) dataset. The training procedure involves supervised finetuning from TRL.
12
 
 
13
 
14
+ ## Model description
15
+
16
+ - **Model type:** A 7B parameter LLM finetuned on 3k samples from [argilla/oig-30k](https://huggingface.co/datasets/argilla/oig-30k), originally from [laion/OIG](https://huggingface.co/datasets/laion/OIG).
17
+ - **Language(s) (NLP):** Primarily English
18
+ - **License:** Apache 2.0
19
+ - **Finetuned from model:** [mistralai/Mistral-7B-v0.1](https://huggingface.co/mistralai/Mistral-7B-v0.1)
20
+
21
+ ## Usage
22
+
23
+ ```python
24
+ from transformers import AutoTokenizer
25
+ from peft import AutoPeftModelForCausalLM
26
+ import torch
27
+
28
+ model_id = "argilla/Mistral-7B-v0.1-chat-OIG"
29
+ model = AutoPeftModelForCausalLM.from_pretrained(
30
+ model_id,
31
+ torch_dtype=torch.bfloat16,
32
+ device_map="auto",
33
+ )
34
+ tokenizer = AutoTokenizer.from_pretrained(model_id)
35
+ tokenizer.pad_token_id = tokenizer.eos_token_id
36
+ text = "<human>: What were Nelson Mandela's relations with the ANC? <bot>:"
37
+ inputs = tokenizer(text, return_tensors="pt").to(model.device)
38
 
39
+ with torch.no_grad():
40
+ outputs = model.generate(input_ids=inputs["input_ids"], max_new_tokens=250, pad_token_id=tokenizer.pad_token_id)
41
+ print(tokenizer.batch_decode(outputs, skip_special_tokens=False)[0])
42
+ ```
43
+
44
+ ### Prompt template
45
+ #### Single step
46
+ ```
47
+ <s><human>: {prompt} <bot>:
48
+ ```
49
+ or
50
+ ```
51
+ Background: {background} <s><human>: {prompt} <bot>:
52
+ ```
53
+ #### Multi-step
54
+ ```
55
+ <s><human>: {prompt_1} <bot>: {response_1}</s><s><human>: {prompt_2} <bot>: {response_2}</s><s><human>: {prompt_3} <bot>:
56
+ ```
57
+ or
58
+ ```
59
+ Background: {background} <s><human>: {prompt_1} <bot>: {response_1}</s><s><human>: {prompt_2} <bot>: {response_2}</s><s><human>: {prompt_3} <bot>:
60
+ ```
61
+
62
+ <!--
63
+ ### Model Sources
64
+
65
+ - **Tutorial:** ...
66
+ -->
67
+
68
+ ### Framework versions
69
+ - Transformers 4.34.0
70
+ - Pytorch 2.0.1+cu118
71
+ - Datasets 2.12.0
72
+ - Tokenizers 0.14.0
73
+ - PEFT 0.5.0