We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1ad4ae6 commit d724673Copy full SHA for d724673
examples/models/llama2/source_transformation/quantize.py
@@ -96,7 +96,13 @@ def quantize(
96
if calibration_tasks is None:
97
calibration_tasks = ["wikitext"]
98
99
- from torchao.quantization.GPTQ import InputRecorder
+ try:
100
+ # torchao 0.3+
101
+ # pyre-ignore
102
+ from torchao._eval import InputRecorder
103
+ except ImportError:
104
+ from torchao.quantization.GPTQ import InputRecorder
105
+
106
from torchao.quantization.quant_api import Int8DynActInt4WeightGPTQQuantizer
107
108
if tokenizer_path is None:
@@ -107,7 +113,7 @@ def quantize(
113
)
114
109
115
inputs = (
110
- InputRecorder(
116
+ InputRecorder( # pyre-ignore
111
117
tokenizer,
112
118
calibration_seq_length,
119
None, # input_prep_func
0 commit comments