Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,369 changes: 16 additions & 1,353 deletions auto_round/compressors/base.py

Large diffs are not rendered by default.

12 changes: 0 additions & 12 deletions auto_round/compressors/diffusion/compressor.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,18 +172,6 @@ def _update_inputs(self, inputs: dict, q_inputs: dict) -> tuple[dict, dict]:
q_inputs = {k: q_inputs.pop(k, None) for k in input_id_str}
return inputs, q_inputs

def _split_inputs(self, inputs: dict, first_input_name: str) -> tuple[dict, dict]:
input_id_str = [key for key in inputs.keys() if "hidden_state" in key]
input_ids = {k: inputs.pop(k, None) for k in input_id_str}
input_others = inputs
return input_ids, input_others

def _get_current_output(self, output: dict, indices: list[int]) -> torch.Tensor:
assert "hidden_states" in output
current_output = [output["hidden_states"][x] for x in indices]
current_output = torch.cat(current_output, dim=self.batch_dim)
return current_output

def _get_current_q_output(
self,
block: torch.nn.Module,
Expand Down
15 changes: 15 additions & 0 deletions auto_round/quantizers/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Copyright (c) 2026 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from auto_round.quantizers.entrypoint import create_quantizers
Loading
Loading