Skip to content

Commit 34db26c

Browse files
authored
Merge pull request #44 from ModelTC/fix_json_save
fix json save
2 parents d921ed3 + 0d03528 commit 34db26c

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

llmc/compression/quantization/quarot.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,11 @@ def preprocess(self):
3232
self.model.get_embed_layers()[0].weight,
3333
):
3434
logger.info('Tie weight! Copy embed_layer for head_layer!')
35-
path = os.join(self.config.model.path, 'config.json')
36-
with open(path, 'w') as f:
35+
path = os.path.join(self.config.model.path, 'config.json')
36+
with open(path, 'r') as f:
3737
config = json.load(f)
38-
config['tie_word_embeddings'] = False
38+
config['tie_word_embeddings'] = False
39+
with open(path, 'w') as f:
3940
json.dump(config, f, indent=4)
4041
del self.model.get_head_layers()[0].weight
4142
w = self.model.get_embed_layers()[0].weight.clone()

0 commit comments

Comments
 (0)