Text Generation
Transformers
PyTorch
Safetensors
English
llama
text-generation-inference
Inference Endpoints
Sachith Gunasekara commited on
Commit
797381e
1 Parent(s): b50a4aa

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +95 -1
README.md CHANGED
@@ -6,4 +6,98 @@ datasets:
6
  - SurgeGlobal/Evol-Instruct
7
  language:
8
  - en
9
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6
  - SurgeGlobal/Evol-Instruct
7
  language:
8
  - en
9
+ ---
10
+ # Model Card for OpenBezoar-SFT
11
+
12
+ ## Summary
13
+ The OpenBezoar-SFT is an instruction-tuned version of [Open LlaMA 3B v2](https://huggingface.co/openlm-research/open_llama_3b_v2) with Q-LoRA on three of our custom datasets synthetically generated from [h2ogpt-gm-oasst1-en-2048-falcon-40b-v2](https://huggingface.co/h2oai/h2ogpt-gm-oasst1-en-2048-falcon-40b-v2).
14
+
15
+ ## Model Details
16
+
17
+ - Base model: [Open LlaMA 3B v2](https://huggingface.co/openlm-research/open_llama_3b_v2)
18
+ - LoRA configuration:
19
+ - r: 16
20
+ - alpha: 16
21
+ - dropout: 0.05
22
+ - target modules: [q_proj, v_proj, k_proj]
23
+ - Datasets used for instruction tuning:
24
+ - [LaMini](https://huggingface.co/datasets/SurgeGlobal/LaMini)
25
+ - [Orca](https://huggingface.co/datasets/SurgeGlobal/Orca)
26
+ - [Evol-Instruct](https://huggingface.co/datasets/SurgeGlobal/Evol-Instruct)
27
+
28
+ ### Model Description
29
+
30
+ OpenBezoar-SFT is built upon the Open Llama 3B v2 architecture and has been fine-tuned to improve its instruction-following abilities.
31
+
32
+ ### Model Sources
33
+
34
+ - **Repository:** [More Information Needed]
35
+ - **Paper :** [More Information Needed]
36
+
37
+ ## Instruction Format
38
+
39
+ We follow a modified version of the Alpaca prompt template as shown below. It is important to utilize this template in order to obtain best responses for instruction related tasks.
40
+ ```
41
+ ### System:
42
+ Below is an instruction that describes a task, optionally paired with an input that provides further context following that instruction. Write a response that appropriately completes the request.
43
+
44
+ ### Instruction:
45
+ {instruction}
46
+
47
+ ### Response:
48
+ ```
49
+ Notice that **no** end-of-sentence (eos) token is being appended.
50
+
51
+ *Note: The system prompt shown in the following figure is the one that the model has been trained on most of the time. However, you may attempt to use any other system prompt that is available in the [Orca](https://arxiv.org/abs/2306.02707) scheme.*
52
+
53
+ ## Usage
54
+
55
+ ```python
56
+ from peft import PeftConfig, PeftModel
57
+ from transformers import AutoModelForCausalLM, AutoTokenizer, GenerationConfig, AutoModelForSeq2SeqLM
58
+
59
+ checkpoint = "SurgeGlobal/OpenBezoar-SFT"
60
+
61
+ tokenizer = AutoTokenizer.from_pretrained(checkpoint)
62
+
63
+ model = AutoModelForCausalLM.from_pretrained(
64
+ checkpoint,
65
+ load_in_4bit=True, # optionally for low resource environments
66
+ device_map="auto"
67
+ )
68
+
69
+ prompt = """### System:
70
+ Below is an instruction that describes a task, optionally paired with an input that provides further context following that instruction. Write a response that appropriately completes the request.
71
+
72
+ ### Instruction:
73
+ {instruction}
74
+
75
+ ### Response:""".format(
76
+ instruction="What is the world state in the year 1597."
77
+ )
78
+
79
+ inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
80
+
81
+ outputs = model.generate(**inputs, max_new_tokens=1024, do_sample=True)
82
+
83
+ print(tokenizer.decode(outputs[0]))
84
+ ```
85
+
86
+ ## Evaluations
87
+ Refer to our self-reported evaluations in our paper (Section 4).
88
+
89
+ ## Limitations
90
+
91
+ - The model might not consistently show improved abilities to follow instructions, and it could respond inappropriately or get stuck in loops.
92
+ - This model is not aligned to human preferences and therefore it may generate harmful and uncensored content.
93
+ - Caution is urged against relying on this model for production or adjacent use-cases.
94
+
95
+ ## Citation
96
+ If you find our work useful, please cite our paper as follows:
97
+ ```
98
+ [More Information Needed]
99
+ ```
100
+
101
+ ## Model Authors
102
+
103
+ Chandeepa Dissanayake, Lahiru Lowe, Sachith Gunasekara, and Yasiru Ratnayake