Skip to content

Commit b89ea66

Browse files
committed
Ruff format
Signed-off-by: Asmita Goswami <[email protected]>
1 parent c80a19a commit b89ea66

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

QEfficient/utils/run_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ def run_vlm_hf_model_on_pytorch_CB(self, model, images, queries):
312312

313313
# Generate tokens
314314
output = model.generate(**inputs, max_new_tokens=self.gen_len, do_sample=False)
315-
offset_output = output[0, inputs["input_ids"].shape[1]:]
315+
offset_output = output[0, inputs["input_ids"].shape[1] :]
316316

317317
# Decode and print output
318318
py_output = self.processor.tokenizer.decode(offset_output).strip()

tests/transformers/models/test_image_text_to_text_models.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ def check_image_text_to_text_pytorch_vs_kv_vs_ort_vs_ai100(
355355
assert (pytorch_hf_tokens == qpc_tokens).all(), "Tokens don't match for pytorch HF output and QPC output"
356356

357357
# testing for CB models
358-
if not kv_offload: # CB not yet enabled for Single QPC
358+
if not kv_offload: # CB not yet enabled for Single QPC
359359
return
360360
images = [image] * full_batch_size
361361
queries = [query] * full_batch_size
@@ -400,10 +400,13 @@ def check_image_text_to_text_pytorch_vs_kv_vs_ort_vs_ai100(
400400
qpc_tokens = exec_info.generated_ids[:, :max_gen_len]
401401

402402
for i in range(full_batch_size):
403-
assert (pytorch_hf_tokens[i] == qpc_tokens[i]).all(), f"Tokens don't match for prompt {i} between HF and QPC output"
403+
assert (pytorch_hf_tokens[i] == qpc_tokens[i]).all(), (
404+
f"Tokens don't match for prompt {i} between HF and QPC output"
405+
)
404406

405407
return
406408

409+
407410
def check_molmo_image_text_to_text_pytorch_vs_kv_vs_ort_vs_ai100(
408411
model_name: str,
409412
img_url: str,
@@ -587,7 +590,8 @@ def check_intern_image_text_to_text_pytorch_vs_kv_vs_ort_vs_ai100(
587590
@pytest.mark.on_qaic
588591
@pytest.mark.multimodal
589592
@pytest.mark.parametrize(
590-
"model_name, kv_offload, batch_size, full_batch_size, prompt_len, ctx_len, img_size, img_url, query, n_layer", test_models_config
593+
"model_name, kv_offload, batch_size, full_batch_size, prompt_len, ctx_len, img_size, img_url, query, n_layer",
594+
test_models_config,
591595
)
592596
def test_image_text_to_text_pytorch_vs_kv_vs_ort_vs_ai100(
593597
model_name, kv_offload, batch_size, full_batch_size, prompt_len, ctx_len, img_size, img_url, query, n_layer

0 commit comments

Comments
 (0)