Skip to content

Commit

Permalink
clean
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-aqiao committed Dec 17, 2024
1 parent b573fa9 commit 6d6cbd9
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 22 deletions.
19 changes: 1 addition & 18 deletions examples/offline_inference_audio_language.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,23 +61,7 @@ def run_qwen2_audio(question: str, audio_count: int):
return llm, prompt, stop_token_ids


# Whisper
def run_whisper(question: str, audio_count: int):
model_name = "openai/whisper-large-v3"

llm = LLM(model=model_name,
max_model_len=448,
max_num_seqs=1,
enforce_eager=True,
limit_mm_per_prompt={"audio": audio_count})

prompt = "<|startoftranscript|><|en|>"
stop_token_ids = None
return llm, prompt, stop_token_ids


model_example_map = {"ultravox": run_ultravox, "qwen2_audio": run_qwen2_audio,
"whisper": run_whisper}
model_example_map = {"ultravox": run_ultravox, "qwen2_audio": run_qwen2_audio}


def main(args):
Expand Down Expand Up @@ -106,7 +90,6 @@ def main(args):

assert args.num_prompts > 0
inputs = {"prompt": prompt, "multi_modal_data": mm_data}
#inputs = {"encoder_prompt": {"prompt": "", "multi_modal_data": mm_data}, "decoder_prompt": prompt}
if args.num_prompts > 1:
# Batch inference
inputs = [inputs] * args.num_prompts
Expand Down
5 changes: 1 addition & 4 deletions vllm/attention/backends/flash_attn.py
Original file line number Diff line number Diff line change
Expand Up @@ -718,10 +718,7 @@ def forward(
query = query[:num_prefill_query_tokens]
prefill_output = output[:num_prefill_query_tokens]
assert query.shape[0] == num_prefill_query_tokens
assert decode_query.shape[0] == num_decode_query_tokens, (
f"decode_query.shape: {decode_query.shape}, "
f"num_decode_query_tokens: {num_decode_query_tokens}"
)
assert decode_query.shape[0] == num_decode_query_tokens

if prefill_meta := attn_metadata.prefill_metadata:
# Prompt run.
Expand Down
1 change: 1 addition & 0 deletions vllm/inputs/preprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ def _get_default_enc_dec_decoder_prompt(self) -> List[int]:
* prompt_token_ids
'''

bos_token_id = self.get_bos_token_id()
assert bos_token_id is not None
return [bos_token_id]
Expand Down

0 comments on commit 6d6cbd9

Please sign in to comment.