Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 1 addition & 15 deletions examples/offline_inference/eagle.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
import json
import os

from transformers import AutoTokenizer

from vllm import LLM, SamplingParams


Expand Down Expand Up @@ -67,19 +65,8 @@ def main():

max_model_len = 2048

tokenizer = AutoTokenizer.from_pretrained(model_dir)

prompts = load_prompts(args.dataset, args.num_prompts)

prompt_ids = [
tokenizer.apply_chat_template([{
"role": "user",
"content": prompt
}],
add_generation_prompt=True)
for prompt in prompts
]

llm = LLM(
model=model_dir,
trust_remote_code=True,
Expand All @@ -102,8 +89,7 @@ def main():

sampling_params = SamplingParams(temperature=args.temp, max_tokens=256)

outputs = llm.generate(prompt_token_ids=prompt_ids,
sampling_params=sampling_params)
outputs = llm.generate(prompts=prompts, sampling_params=sampling_params)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like you simply removed the alternative input. We still support prompt token ID inputs, but it has to be inside a dictionary passed to prompts. You can check the type annotations for more information.


# print the generated text
for output in outputs:
Expand Down