--- library_name: peft datasets: - laion/OIG - argilla/oig-30k language: - en license: apache-2.0 --- # Model card for Mistral-7B-v0.1-chat-OIG 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. ## Model description - **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). - **Language(s) (NLP):** Primarily English - **License:** Apache 2.0 - **Finetuned from model:** [mistralai/Mistral-7B-v0.1](https://huggingface.co/mistralai/Mistral-7B-v0.1) ## Usage ```python from transformers import AutoTokenizer from peft import AutoPeftModelForCausalLM import torch model_id = "argilla/Mistral-7B-v0.1-chat-OIG" model = AutoPeftModelForCausalLM.from_pretrained( model_id, torch_dtype=torch.bfloat16, device_map="auto", ) tokenizer = AutoTokenizer.from_pretrained(model_id) tokenizer.pad_token_id = tokenizer.eos_token_id text = ": What were Nelson Mandela's relations with the ANC? :" inputs = tokenizer(text, return_tensors="pt").to(model.device) with torch.no_grad(): outputs = model.generate(input_ids=inputs["input_ids"], max_new_tokens=250, pad_token_id=tokenizer.pad_token_id) print(tokenizer.batch_decode(outputs, skip_special_tokens=False)[0]) ``` ### Prompt template #### Single step ``` : {prompt} : ``` or ``` Background: {background} : {prompt} : ``` #### Multi-step ``` : {prompt_1} : {response_1}: {prompt_2} : {response_2}: {prompt_3} : ``` or ``` Background: {background} : {prompt_1} : {response_1}: {prompt_2} : {response_2}: {prompt_3} : ``` ### Framework versions - Transformers 4.34.0 - Pytorch 2.0.1+cu118 - Datasets 2.12.0 - Tokenizers 0.14.0 - PEFT 0.5.0