Commit
·
89e773e
1
Parent(s):
2452fa4
Create README.md
Browse files
README.md
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: cc
|
| 3 |
+
datasets:
|
| 4 |
+
- VMware/open-instruct-v1-oasst-dolly-hhrlhf
|
| 5 |
+
language:
|
| 6 |
+
- en
|
| 7 |
+
library_name: transformers
|
| 8 |
+
pipeline_tag: text-generation
|
| 9 |
+
---
|
| 10 |
+
# rahuldshetty/vmw-open-llama-13b-open-instruct-ntk4k-8bit
|
| 11 |
+
|
| 12 |
+
This is a 8bit quantized version of VMware's Open-LLAMA-13B model that supports 4k context lengths through NTK Scaled Embeddings.
|
| 13 |
+
Quantization is performed using [bitsandbytes](https://huggingface.co/docs/transformers/main_classes/quantization#load-a-large-model-in-8bit).
|
| 14 |
+
|
| 15 |
+
**Below details are taken from the official model repository**
|
| 16 |
+
|
| 17 |
+
# VMware/open-llama-13B-open-instruct
|
| 18 |
+
Instruction-tuned version of the fully trained Open LLama 13B model. The model is open for <b>COMMERCIAL USE</b>. <br>
|
| 19 |
+
|
| 20 |
+
<b> NOTE </b> : The model was trained using the Alpaca prompt template \
|
| 21 |
+
<b> NOTE </b> : Fast tokenizer results in incorrect encoding, set the ```use_fast = False``` parameter, when instantiating the tokenizer\
|
| 22 |
+
<b> NOTE </b> : The model might struggle with code as the tokenizer merges multiple spaces
|
| 23 |
+
|
| 24 |
+
## License
|
| 25 |
+
- <b>Commercially Viable </b>
|
| 26 |
+
- Instruction dataset, [VMware/open-instruct-v1-oasst-dolly-hhrlhf](https://huggingface.co/datasets/VMware/open-instruct-v1-oasst-dolly-hhrlhf) is under cc-by-sa-3.0
|
| 27 |
+
- Language Model, ([openlm-research/open_llama_13b](https://huggingface.co/openlm-research/open_llama_13b)) is under apache-2.0
|
| 28 |
+
|
| 29 |
+
|
| 30 |
+
## Nomenclature
|
| 31 |
+
|
| 32 |
+
- Model : Open-llama
|
| 33 |
+
- Model Size: 13B parameters
|
| 34 |
+
- Dataset: Open-instruct-v1 (oasst,dolly, hhrlhf)
|
| 35 |
+
|
| 36 |
+
## Use in Transformers
|
| 37 |
+
|
| 38 |
+
```
|
| 39 |
+
import os
|
| 40 |
+
import torch
|
| 41 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 42 |
+
|
| 43 |
+
model_name = 'VMware/open-llama-13b-open-instruct'
|
| 44 |
+
|
| 45 |
+
|
| 46 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name, use_fast=False)
|
| 47 |
+
|
| 48 |
+
model = AutoModelForCausalLM.from_pretrained(model_name, torch_dtype=torch.float16, device_map='sequential')
|
| 49 |
+
|
| 50 |
+
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:"
|
| 51 |
+
|
| 52 |
+
prompt = 'Explain in simple terms how the attention mechanism of a transformer model works'
|
| 53 |
+
|
| 54 |
+
|
| 55 |
+
inputt = prompt_template.format(instruction= prompt)
|
| 56 |
+
input_ids = tokenizer(inputt, return_tensors="pt").input_ids.to("cuda")
|
| 57 |
+
|
| 58 |
+
output1 = model.generate(input_ids, max_length=512)
|
| 59 |
+
input_length = input_ids.shape[1]
|
| 60 |
+
output1 = output1[:, input_length:]
|
| 61 |
+
output = tokenizer.decode(output1[0])
|
| 62 |
+
|
| 63 |
+
print(output)
|
| 64 |
+
```
|
| 65 |
+
|
| 66 |
+
## Finetuning details
|
| 67 |
+
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)
|
| 68 |
+
## Evaluation
|
| 69 |
+
|
| 70 |
+
<B>TODO</B>
|