Skip to content
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

Write the current version into model configs #160

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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 src/compressed_tensors/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@
from .config import *
from .quantization import QuantizationConfig, QuantizationStatus
from .utils import *
from .version import *
2 changes: 2 additions & 0 deletions src/compressed_tensors/compressors/model_compressor.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

import torch
import transformers
import compressed_tensors
from compressed_tensors.base import (
COMPRESSION_CONFIG_NAME,
QUANTIZATION_CONFIG_NAME,
Expand Down Expand Up @@ -368,6 +369,7 @@ def update_config(self, save_directory: str):
config_data[COMPRESSION_CONFIG_NAME][
SPARSITY_CONFIG_NAME
] = sparsity_config_data
config_data[COMPRESSION_CONFIG_NAME]["version"] = compressed_tensors.__version__

with open(config_file_path, "w") as config_file:
json.dump(config_data, config_file, indent=2, sort_keys=True)
Expand Down
Loading