Views
No views yet

1slices:
2 - sources:
3 - model: Locutusque/Hercules-2.5-Mistral-7B
4 layer_range: [0, 32]
5 - model: openchat/openchat-3.5-0106
6 layer_range: [0, 32]
7merge_method: slerp
8base_model: Locutusque/Hercules-2.5-Mistral-7B
9parameters:
10 t:
11 - filter: self_attn
12 value: [0, 0.5, 0.3, 0.7, 1]
13 - filter: mlp
14 value: [1, 0.5, 0.7, 0.3, 0]
15 - value: 0.5
16dtype: bfloat16pip install --upgrade autoawq autoawq-kernels1from awq import AutoAWQForCausalLM
2from transformers import AutoTokenizer, TextStreamer
3
4model_path = "solidrust/ChatHercules-2.5-Mistral-7B-AWQ"
5system_message = "You are Hercules, incarnated as a powerful AI."
6
7# Load model
8model = AutoAWQForCausalLM.from_quantized(model_path,
9 fuse_layers=True)
10tokenizer = AutoTokenizer.from_pretrained(model_path,
11 trust_remote_code=True)
12streamer = TextStreamer(tokenizer,
13 skip_prompt=True,
14 skip_special_tokens=True)
15
16# Convert prompt to tokens
17prompt_template = """\
18<|im_start|>system
19{system_message}<|im_end|>
20<|im_start|>user
21{prompt}<|im_end|>
22<|im_start|>assistant"""
23
24prompt = "You're standing on the surface of the Earth. "\
25 "You walk one mile south, one mile west and one mile north. "\
26 "You end up exactly where you started. Where are you?"
27
28tokens = tokenizer(prompt_template.format(system_message=system_message,prompt=prompt),
29 return_tensors='pt').input_ids.cuda()
30
31# Generate output
32generation_output = model.generate(tokens,
33 streamer=streamer,
34 max_new_tokens=512)
351<|im_start|>system
2{system_message}<|im_end|>
3<|im_start|>user
4{prompt}<|im_end|>
5<|im_start|>assistant