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.
### System:
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.
### Instruction:
{instruction}
### Response:
Notice that no end-of-sentence (eos) token is being appended.
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 scheme.
Usage
python
1from peft import PeftConfig, PeftModel
2from transformers import AutoModelForCausalLM, AutoTokenizer, GenerationConfig, AutoModelForSeq2SeqLM
34checkpoint ="SurgeGlobal/OpenBezoar-SFT"56tokenizer = AutoTokenizer.from_pretrained(checkpoint)78model = AutoModelForCausalLM.from_pretrained(9 checkpoint,10 load_in_4bit=True,# optionally for low resource environments11 device_map="auto"12)1314prompt ="""### System:
15Below 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.
1617### Instruction:
18{instruction}
1920### Response:""".format(21 instruction="What is the world state in the year 1597."22)2324inputs = tokenizer(prompt, return_tensors="pt").to(model.device)2526outputs = model.generate(**inputs, max_new_tokens=1024, do_sample=True)2728print(tokenizer.decode(outputs[0]))
Evaluations
Refer to our self-reported evaluations in our paper (Section 4).
Limitations
The model might not consistently show improved abilities to follow instructions, and it could respond inappropriately or get stuck in loops.
This model is not aligned to human preferences and therefore it may generate harmful and uncensored content.
Caution is urged against relying on this model for production or adjacent use-cases.
Citation
If you find our work useful, please cite our paper as follows:
@misc{surge2024openbezoar,
title={OpenBezoar: Small, Cost-Effective and Open Models Trained on Mixes of Instruction Data},
author={Chandeepa Dissanayake and Lahiru Lowe and Sachith Gunasekara and Yasiru Ratnayake},
year={2024},
eprint={2404.12195},
archivePrefix={arXiv},
primaryClass={cs.CL}
}
Model Authors
Chandeepa Dissanayake, Lahiru Lowe, Sachith Gunasekara, and Yasiru Ratnayake