Lumina-4 is a Mixture of Experts (MoE) made with
LazyMergekit.
This model has improved roleplaying and storytelling from
Lumina-3.5 while still retaining its strength. A slight improvement on the Open LLM leaderboard.
It uses a context window of up to 32k.
1Input: 25 - 4 * 2 + 3 = ?
2------------------------------------
3Output: The given mathematical expression is 25 - 4 * 2 + 3. To solve it, we should follow the order of operations (PEMDAS):
4
51. Parentheses: There are none in this equation.
62. Exponents: None present.
73. Multiplication and Division: We perform multiplications before divisions from left to right. In this case, 4 * 2 = 8. Now our equation becomes 25 - 8 + 3.
84. Addition and Subtraction: We perform additions before subtractions from left to right. Here, we have a subtraction then an addition: 25 - 8 = 17, then 17 + 3 = 20.
9
10So the result of the expression 25 - 4 * 2 + 3 is 20.
1!pip install -qU transformers bitsandbytes accelerate
2
3from transformers import AutoTokenizer
4import transformers
5import torch
6
7model = "Ppoyaa/Lumina-4"
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"])