Downloads · 30 days
0
burtenshaw/notus-merged-with-code-mistral-so-its-better-at-coding
notus-merged-with-code-mistral-so-its-better-at-coding is a machine learning model from burtenshaw. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
Notus-Code is a merge of the following models using LazyMergekit: argilla/notus-7b-v1 ajibawa-2023/Code-Mistral-7B
Downloads · 30 days
0
Access
Public
Updated Apr 2, 2024
Repo size
—
Likes
3
Public
Click a slice to open those files.
.md1.6 KB · 51%
From the Hugging Face model README
Notus-Code is a merge of the following models using LazyMergekit:
slices:
- sources:
- model: argilla/notus-7b-v1
layer_range: [0, 32]
- model: ajibawa-2023/Code-Mistral-7B
layer_range: [0, 32]
merge_method: slerp
base_model: argilla/notus-7b-v1
parameters:
t:
- filter: self_attn
value: [0, 0.5, 0.3, 0.7, 1]
- filter: mlp
value: [1, 0.5, 0.7, 0.3, 0]
- value: 0.5
dtype: bfloat16
!pip install -qU transformers accelerate
from transformers import AutoTokenizer
import transformers
import torch
model = "burtenshaw/Notus-Code"
messages = [{"role": "user", "content": "What is a large language model?"}]
tokenizer = AutoTokenizer.from_pretrained(model)
prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
pipeline = transformers.pipeline(
"text-generation",
model=model,
torch_dtype=torch.float16,
device_map="auto",
)
outputs = pipeline(prompt, max_new_tokens=256, do_sample=True, temperature=0.7, top_k=50, top_p=0.95)
print(outputs[0]["generated_text"])