Views
No views yet
pytorch_model.bin: Trained EAGLE Draft model weightsconfig.json: Model configuration file (OLMoE architecture)tokenizer_config.json: Tokenizer configuration filemodeling_olmoe_kv.py: OLMoE-specific model code (required for EAGLE inference)eagle_data.json: Training dataset (ShareGPT questions + OLMoE-generated answers).gitattributes: Git LFS settings, etc.pytorch_model.bin, config.json, and tokenizer_config.jsonmodeling_olmoe_kv.pyEAGLE/eagle/model/.from eagle.model.modeling_olmoe_kv import OlmoeForCausalLM1from eagle.model.ea_model import EaModel
2from fastchat.model import get_conversation_template
3from transformers import AutoTokenizer, AutoModelForCausalLM
4import torch
5
6tokenizer = AutoTokenizer.from_pretrained('allenai/OLMoE-1B-7B-0125-Instruct')
7model = EaModel.from_pretrained(
8 base_model_path='allenai/OLMoE-1B-7B-0125-Instruct',
9 ea_model_path='wantsleep/OLMoE_1B_7B_Eagle3',
10 torch_dtype='bfloat16',
11 low_cpu_mem_usage=True,
12 total_token=-1
13)
14
15your_message = "Why we study math?"
16conv = get_conversation_template("vicuna")
17conv.append_message(conv.roles[0], your_message)
18conv.append_message(conv.roles[1], None)
19prompt = conv.get_prompt()
20input_ids = model.tokenizer([prompt]).input_ids
21input_ids = torch.as_tensor(input_ids).to(DEVICE)
22
23output_ids = model.eagenerate(input_ids, temperature=0.5, max_new_tokens=512, top_k=8)
24output = model.tokenizer.decode(output_ids[0])
25print(output)modeling_olmoe_kv.py must be included in your EAGLE inference code for correct operation.