Skip to content

Commit 4603264

Browse files
Potential fix for pull request finding
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
1 parent a5d845c commit 4603264

3 files changed

Lines changed: 1 addition & 5 deletions

File tree

superbench/benchmarks/micro_benchmarks/_export_torch_to_onnx.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818

1919
class torch2onnxExporter():
2020
"""PyTorch model to ONNX exporter."""
21-
2221
def __init__(self):
2322
"""Constructor."""
2423
from transformers import BertConfig, GPT2Config, LlamaConfig
@@ -360,7 +359,6 @@ def _build_vision_export_inputs(self, model, batch_size, model_dtype, device):
360359
dynamic_axes = {'pixel_values': {0: 'batch_size'}, 'output': {0: 'batch_size'}}
361360

362361
class VisionModelWrapper(torch.nn.Module):
363-
364362
def __init__(self, model):
365363
super().__init__()
366364
self.model = model
@@ -398,7 +396,6 @@ def _build_nlp_export_inputs(self, model, batch_size, seq_length, device):
398396
}
399397

400398
class NLPModelWrapper(torch.nn.Module):
401-
402399
def __init__(self, model):
403400
super().__init__()
404401
self.model = model

superbench/benchmarks/micro_benchmarks/huggingface_model_loader.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ def _get_model_size(self, model: PreTrainedModel) -> float:
344344
Returns:
345345
Number of parameters in millions.
346346
"""
347-
return float(sum(p.numel() for p in model.parameters())) / 1_000_000
347+
return float(sum(p.numel() for p in model.parameters())) / 1_000_000 # type: ignore[attr-defined]
348348

349349
@staticmethod
350350
def estimate_param_count_from_config(hf_config) -> Optional[int]:

tests/benchmarks/micro_benchmarks/test_huggingface_e2e.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
)
2929
class TestHuggingFaceE2E:
3030
"""End-to-end tests for HuggingFace model loading."""
31-
3231
@pytest.fixture
3332
def loader(self, tmp_path):
3433
"""Create a loader instance with an isolated per-test cache dir."""

0 commit comments

Comments
 (0)