Credit to Fernando Fernandes and Eric Hartford for their project
laserRMT
This model is a medium-sized MoE implementation based on
cognitivecomputations/dolphin-2.6-mistral-7b-dpo-laser
-
The process is outlined in this
notebook
-
The mergekit_config is in the files.
-
The models used in the configuration are not lasered, but the final product is. This is an update from the last version.
-
This process is experimental. Your mileage may vary.
Thanks to user
bartowski we now have exllamav2 quantizations in 3.5 through 8 bpw. They are available here:
His quantizations represent the first ~13B model with GQA support. Check out his repo for more information!
Switch the commented model definition to use in 4-bit. Should work with 9GB and still exceed the single 7B model by 5-6 points roughly
1from transformers import AutoModelForCausalLM, AutoTokenizer
2
3def generate_response(prompt):
4 """
5 Generate a response from the model based on the input prompt.
6
7 Args:
8 prompt (str): Prompt for the model.
9
10 Returns:
11 str: The generated response from the model.
12 """
13 # Tokenize the input prompt
14 inputs = tokenizer(prompt, return_tensors="pt")
15
16 # Generate output tokens
17 outputs = model.generate(**inputs, max_new_tokens=256, eos_token_id=tokenizer.eos_token_id, pad_token_id=tokenizer.pad_token_id)
18
19 # Decode the generated tokens to a string
20 response = tokenizer.decode(outputs[0], skip_special_tokens=True)
21
22 return response
23
24# Load the model and tokenizer
25model_id = "macadeliccc/laser-dolphin-mixtral-2x7b-dpo"
26tokenizer = AutoTokenizer.from_pretrained(model_id)
27model = AutoModelForCausalLM.from_pretrained(model_id, load_in_4bit=True)
28
29prompt = "Write a quicksort algorithm in python"
30
31# Generate and print responses for each language
32print("Response:")
33print(generate_response(prompt), "\n")
----Benchmark Complete----
2024-01-31 16:55:37
Time taken: 31.1 mins
Prompt Format: ChatML
Model: macadeliccc/laser-dolphin-mixtral-2x7b-dpo-GGUF
Score (v2): 72.76
Parseable: 171.0
---------------
Batch completed
Time taken: 31.2 mins
---------------
Fernando Fernandes Neto and Eric Hartford. "Optimizing Large Language Models Using Layer-Selective Rank Reduction and Random Matrix Theory." 2024.
1@article{sharma2023truth,
2title={The Truth is in There: Improving Reasoning in Language Models with Layer-Selective Rank Reduction},
3author={Sharma, Pratyusha and Ash, Jordan T and Misra, Dipendra},
4journal={arXiv preprint arXiv:2312.13558},
5year={2023} }
1@article{gao2021framework,
2 title={A framework for few-shot language model evaluation},
3 author={Gao, Leo and Tow, Jonathan and Biderman, Stella and Black, Sid and DiPofi, Anthony and Foster, Charles and Golding, Laurence and Hsu, Jeffrey and McDonell, Kyle and Muennighoff, Niklas and others},
4 journal={Version v0. 0.1. Sept},
5 year={2021}
6}
Detailed results can be found
here