Skip to content

Enhance load_empty_model import #1930

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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 change: 1 addition & 0 deletions neural_compressor/torch/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@
# 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 .utils import load_empty_model
2 changes: 1 addition & 1 deletion test/3x/torch/quantization/weight_only/test_gptq.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ def test_layer_wise(self):
model = convert(model)
q_label = model(self.example_inputs)[0]

from neural_compressor.torch.utils import load_empty_model
from neural_compressor.torch import load_empty_model

model = load_empty_model("hf-internal-testing/tiny-random-GPTJForCausalLM")

Expand Down
2 changes: 1 addition & 1 deletion test/3x/torch/quantization/weight_only/test_rtn.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ def test_quant_lm_head(self):
), "The tied lm_head weight is not deep copied, please check!"

def test_layer_wise(self):
from neural_compressor.torch.utils import load_empty_model
from neural_compressor.torch import load_empty_model

model = load_empty_model("hf-internal-testing/tiny-random-GPTJForCausalLM")
quant_config = RTNConfig(
Expand Down
Loading