Skip to content

Commit

Permalink
revert basic.py
Browse files Browse the repository at this point in the history
  • Loading branch information
alexm-redhat committed Feb 14, 2025
1 parent fbd5df0 commit abeba7b
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions examples/offline_inference/basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,15 @@
"The future of AI is",
]
# Create a sampling params object.
sampling_params = SamplingParams() #temperature=0.8, top_p=0.95)
sampling_params = SamplingParams(temperature=0.8, top_p=0.95)

# Create an LLM.
# llm = LLM(model="facebook/opt-125m")
llm = LLM(model="Qwen/Qwen2-1.5B-Instruct", max_model_len=512, max_num_seqs=16)
llm = LLM(model="facebook/opt-125m")
# Generate texts from the prompts. The output is a list of RequestOutput objects
# that contain the prompt, generated text, and other information.
outputs = llm.generate(prompts, sampling_params)
# Print the outputs.
for output in outputs:
prompt = output.prompt
generated_text = output.outputs[0].text
print(f"Prompt: {prompt!r}, Generated text: {generated_text!r}")
print(f"Prompt: {prompt!r}, Generated text: {generated_text!r}")

0 comments on commit abeba7b

Please # to comment.