Downloads · 30 days
0
bjoernp/alpaca-cerebras-6.7B
alpaca-cerebras-6.7B is a machine learning model from bjoernp. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for transformers. The card lists the license as apache-2.0.
This repository contains the adapter weights for the Cerebras-6.7B model finetuned on the cleaned version of the alpaca dataset following github.com/tloen/alpaca-lora. Find the code used for finetuning at our fork: gi…
Downloads · 30 days
0
Access
Public
Updated Mar 31, 2023
Repo size
12.1 MB
Likes
3
Public
Click a slice to open those files.
.bin12.1 MB · 100%
From the Hugging Face model README
This repository contains the adapter weights for the Cerebras-6.7B model finetuned on the cleaned version of the alpaca dataset following github.com/tloen/alpaca-lora. Find the code used for finetuning at our fork: github.com/bjoernpl/cerebras-lora.
Copied from cerebras/Cerebras-GPT-6.7B model card:
The Cerebras-GPT family is released to facilitate research into LLM scaling laws using open architectures and data sets and demonstrate the simplicity of and scalability of training LLMs on the Cerebras software and hardware stack. All Cerebras-GPT models are available on Hugging Face.
The family includes 111M, 256M, 590M, 1.3B, 2.7B, 6.7B, and 13B models.
All models in the Cerebras-GPT family have been trained in accordance with Chinchilla scaling laws (20 tokens per model parameter) which is compute-optimal.
These models were trained on the Andromeda AI supercomputer comprised of 16 CS-2 wafer scale systems. Cerebras' weight streaming technology simplifies the training of LLMs by disaggregating compute from model storage. This allowed for efficient scaling of training across nodes using simple data parallelism.
Cerebras systems for pre-training and fine tuning are available in the cloud via the Cerebras Model Studio. Cerebras CS-2 compatible checkpoints are available in Cerebras Model Zoo.
See github.com/bjoernpl/cerebras-lora for a Gradio demo and more code.
This model can be easily loaded using the AutoModelForCausalLM functionality:
from transformers import AutoTokenizer, AutoModelForCausalLM
from peft import PeftModel
tokenizer = AutoTokenizer.from_pretrained("cerebras/Cerebras-GPT-6.7B")
model = AutoModelForCausalLM.from_pretrained("cerebras/Cerebras-GPT-6.7B", torch_dtype=torch.float16, device_map='auto', load_in_8bit=True)
model = PeftModel.from_pretrained(model, "bjoernp/alpaca-cerebras-6.7B", torch_dtype=torch.float16, device_map='auto')
text = "Generative AI is "
And can be used with Hugging Face Pipelines
from transformers import pipeline
pipe = pipeline("text-generation", model=model, tokenizer=tokenizer)
generated_text = pipe(text, max_length=50, do_sample=False, no_repeat_ngram_size=2)[0]
print(generated_text['generated_text'])
or with model.generate()
inputs = tokenizer(text, return_tensors="pt")
outputs = model.generate(**inputs, num_beams=5,
max_new_tokens=50, early_stopping=True,
no_repeat_ngram_size=2)
text_output = tokenizer.batch_decode(outputs, skip_special_tokens=True)
print(text_output[0])
<br><br>
Experiments were conducted using a private infrastructure, which has a carbon efficiency of 0.432 kgCO<sub>2</sub>eq/kWh. A cumulative of 5 hours of computation was performed on hardware of type RTX 3090Ti (TDP of 450W).
Total emissions are estimated to be 0.97 kgCO<sub>2</sub>eq of which 0 percents were directly offset.
Carbon emissions were estimated using the Machine Learning Impact calculator presented in Lacoste et al. (2019).