--- license: cc datasets: - VMware/open-instruct-v1-oasst-dolly-hhrlhf language: - en library_name: transformers pipeline_tag: text-generation --- # VMware/open-llama-7B-open-instruct Instruction-tuned version of SalesForce/Xgen-7b-8k-base. The model is open for COMMERCIAL USE.
We expanded Open-instruct with additional commercially viable zero-shot COT datasets from Flan v2 (~70k). (TODO: List out the datasets)
The model supports up to 8192 tokens NOTE : The model was trained using the Alpaca prompt template ## License - Commercially Viable - The instruction datasets used for instruction tuning are open for commercial usage. (TODO LIST OUT THE DATASETS) - Language Model, ([Salesforce/xgen-7b-8k-base](https://huggingface.co/Salesforce/xgen-7b-8k-base)) is under apache-2.0 ## Use in Transformers ``` import os import torch from transformers import AutoModelForCausalLM, AutoTokenizer model_name = 'VMware/xgen-7b-8k-open-instruct' tokenizer = AutoTokenizer.from_pretrained(model_name, use_fast=False, trust_remote_code = True) model = AutoModelForCausalLM.from_pretrained(model_name, torch_dtype=torch.bfloat16, device_map='sequential') prompt_template = "Below is an instruction that describes a task. Write a response that appropriately completes the request.\n\n### Instruction:\n{instruction}\n\n### Response:" prompt = 'Explain in simple terms how the attention mechanism of a transformer model works' inputt = prompt_template.format(instruction= prompt) input_ids = tokenizer(inputt, return_tensors="pt").input_ids.to("cuda") output1 = model.generate(input_ids, max_length=8192) input_length = input_ids.shape[1] output1 = output1[:, input_length:] output = tokenizer.decode(output1[0]) print(output) ``` ## Finetuning details The finetuning scripts will be available in our [RAIL Github Repository](https://github.com/vmware-labs/research-and-development-artificial-intelligence-lab/tree/main/instruction-tuning) ## Evaluation TODO