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

chore: remove saving model config in tensorize_model script #8

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
9 changes: 2 additions & 7 deletions scripts/tensorize_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,7 @@ def tensorize_model(
serializer.write_module(model)
serializer.close()

# Write config to tensorized model weights directory
dir_path = os.path.dirname(tensorizer_path)
config_path = os.path.join(dir_path, 'config.json')
model_config.save_pretrained(config_path)

logger.info(f"Tensorized model {model_name} in {dtype} and wrote tensors to {tensorizer_path} and config to {config_path}...")
logger.info(f"Tensorized model {model_name} in {dtype} and wrote tensors to {tensorizer_path}...")

return {"tensorized_weights_path": tensorizer_path, "dtype": dtype}

Expand All @@ -87,4 +82,4 @@ def tensorize_model(
model_path=args.model_path,
tensorizer_path=args.tensorizer_path,
dtype=args.dtype
)
)