Memgpt-3x7b-MOE is a Mixure of Experts (MoE) made with the following models using
LazyMergekit:
1base_model: liminerity/Memgpt-slerp-7b-5
2gate_mode: hidden
3dtype: bfloat16
4experts:
5 - source_model: starsnatched/MemGPT-DPO
6 positive_prompts:
7 - "versatile"
8 - "helpful"
9 - "factual"
10 - "integrated"
11 - "adaptive"
12 - "comprehensive"
13 - "balanced"
14 negative_prompts:
15 - "specialized"
16 - "narrow"
17 - "focused"
18 - "limited"
19 - "specific"
20
21 - source_model: starsnatched/MemGPT-3
22 positive_prompts:
23 - "analytical"
24 - "accurate"
25 - "logical"
26 - "knowledgeable"
27 - "precise"
28 - "calculate"
29 - "compute"
30 - "solve"
31 - "work"
32 - "python"
33 - "javascript"
34 - "programming"
35 - "algorithm"
36 - "tell me"
37 - "assistant"
38 negative_prompts:
39 - "creative"
40 - "abstract"
41 - "imaginative"
42 - "artistic"
43 - "emotional"
44 - "mistake"
45 - "inaccurate"
46
47 - source_model: starsnatched/MemGPT
48 positive_prompts:
49 - "instructive"
50 - "clear"
51 - "directive"
52 - "helpful"
53 - "informative"
54 negative_prompts:
55 - "exploratory"
56 - "open-ended"
57 - "narrative"
58 - "speculative"
59 - "artistic"
1!pip install -qU transformers bitsandbytes accelerate
2
3from transformers import AutoTokenizer
4import transformers
5import torch
6
7model = "liminerity/Memgpt-3x7b-MOE"
8
9tokenizer = AutoTokenizer.from_pretrained(model)
10pipeline = transformers.pipeline(
11 "text-generation",
12 model=model,
13 model_kwargs={"torch_dtype": torch.float16, "load_in_4bit": True},
14)
15
16messages = [{"role": "user", "content": "Explain what a Mixture of Experts is in less than 100 words."}]
17prompt = pipeline.tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
18outputs = pipeline(prompt, max_new_tokens=256, do_sample=True, temperature=0.7, top_k=50, top_p=0.95)
19print(outputs[0]["generated_text"])