Skip to content

Commit

Permalink
Revert offline_inference_vision_language.py
Browse files Browse the repository at this point in the history
  • Loading branch information
mgoin authored Dec 2, 2024
1 parent 593ae17 commit 4e730ab
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions examples/offline_inference_vision_language.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
For most models, the prompt format should follow corresponding examples
on HuggingFace model repository.
"""
import time

from transformers import AutoTokenizer

from vllm import LLM, SamplingParams
Expand All @@ -26,7 +24,6 @@ def run_llava(question: str, modality: str):
prompt = f"USER: <image>\n{question}\nASSISTANT:"

llm = LLM(model="llava-hf/llava-1.5-7b-hf", max_model_len=4096)

stop_token_ids = None
return llm, prompt, stop_token_ids

Expand Down Expand Up @@ -517,10 +514,7 @@ def main(args):
},
} for _ in range(args.num_prompts)]

start_time = time.time()
outputs = llm.generate(inputs, sampling_params=sampling_params)
elapsed_time = time.time() - start_time
print("generate time = {}".format(elapsed_time))

for o in outputs:
generated_text = o.outputs[0].text
Expand Down

0 comments on commit 4e730ab

Please sign in to comment.