Skip to content

Commit 5f492e7

Browse files
committed
CI failures addressed
Signed-off-by: Asmita Goswami <asmigosw@qti.qualcomm.com>
1 parent b16613e commit 5f492e7

File tree

4 files changed

+9
-4
lines changed

4 files changed

+9
-4
lines changed

QEfficient/transformers/models/modeling_auto.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4221,7 +4221,7 @@ def cloud_ai_100_feature_generate(
42214221
torch.nn.functional.pad(inputs["input_values"], (0, self.seq_len - input_ids_len), "constant", 0)
42224222
)
42234223
needed_dtype = getattr(self.model.config, "torch_dtype", torch.float32)
4224-
input_values = input_values.astype(CUSTOM_IO_DTYPE_MAP[needed_dtype])
4224+
input_values = input_values.astype(TORCH_TO_NUMPY_DTYPE_MAP[needed_dtype])
42254225
inputs = dict(input_values=input_values)
42264226
outputs = self.qpc_session.run(inputs)
42274227

examples/audio/wav2vec2_inference.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
import argparse
99

10+
import torch
1011
from datasets import load_dataset
1112
from transformers import AutoProcessor
1213

@@ -40,7 +41,7 @@ def main():
4041
processor = AutoProcessor.from_pretrained(args.model_name)
4142

4243
## STEP 2 -- Load the model
43-
model = QEFFAutoModelForCTC.from_pretrained(args.model_name)
44+
model = QEFFAutoModelForCTC.from_pretrained(args.model_name, torch_dtype=torch.float32)
4445

4546
## STEP 3 -- Compile the model
4647
model.compile(num_cores=args.num_cores)

tests/transformers/models/test_audio_embedding_models.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
test_models = config_data["audio_embedding_models"]
3232

3333

34-
def load_ctc_model(model_config):
34+
def load_ctc_model(model_config, torch_dtype: Optional[torch.dtype] = torch.float32):
3535
"""
3636
Function to load model from huggingface
3737
--------
@@ -48,6 +48,7 @@ def load_ctc_model(model_config):
4848
model_path,
4949
attn_implementation="eager",
5050
low_cpu_mem_usage=False,
51+
torch_dtype=torch_dtype,
5152
) # Run models for single layers only
5253
params = sum(p.numel() for p in model_hf.parameters())
5354
model_hf.eval()

tests/transformers/models/test_causal_lm_models.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,11 @@
4343
test_models_qnn = [model["model_name"] for model in qnn_models]
4444
test_models_blockedKV = [model["model_name"] for model in blockedKV_models]
4545

46+
all_models = causal_lm_models + causal_lm_fp16_models
47+
4648
# Create a dictionary mapping model names to their configs
47-
model_config_dict = {model["model_name"]: model for model in causal_lm_models}
49+
model_config_dict = {model["model_name"]: model for model in all_models}
50+
breakpoint()
4851

4952

5053
def get_hf_config_from_custom_config(model_name):

0 commit comments

Comments
 (0)