Skip to content

Commit 38b9093

Browse files
committed
Fix type hint (compatible with pt<2.4)
Signed-off-by: Andrea Fasoli <[email protected]>
1 parent 1026a4a commit 38b9093

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

fms_mo/quant/ptq.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
# Standard
2525
from functools import partial
26-
from typing import Optional
26+
from typing import Optional, Union
2727
import logging
2828
import math
2929
import random
@@ -2388,7 +2388,7 @@ def get_act_scales(
23882388
model,
23892389
dloader,
23902390
qcfg: dict,
2391-
device: Optional[str | torch.device] = None,
2391+
device: Optional[Union[str, torch.device]] = None,
23922392
):
23932393
"""Compute smoothquant activation scales of quantized linear layers.
23942394
Model and examples are moved to selected device, if provided.
@@ -2420,7 +2420,7 @@ def get_act_scales(
24202420

24212421
for data_mb, _ in zip(pbar, range(n_samples)):
24222422
qcfg["sample_id"] += 1
2423-
data_mb = move_to(data_mb, device)
2423+
data_mb = move_to(data_mb, dev)
24242424
if (
24252425
qcfg["nbits_bmm1"] < 32
24262426
or qcfg["nbits_bmm2"] < 32

0 commit comments

Comments
 (0)