Skip to content
This repository has been archived by the owner on Aug 30, 2024. It is now read-only.

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Mar 1, 2024
1 parent 36c10a0 commit 5fdc7bc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions neural_speed/convert/convert_qwen.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def main(args_in: Optional[List[str]] = None) -> None:
fout.write(struct.pack("i", hparams["kv_channels"] if "kv_channels" in hparams
else int(hparams["hidden_size"]/hparams["num_attention_heads"])))
fout.write(struct.pack("i", ftype))
fout.write(struct.pack("i", hparams["seq_length"] if "seq_length" in hparams
fout.write(struct.pack("i", hparams["seq_length"] if "seq_length" in hparams
else hparams["max_position_embeddings"]))
fout.write(struct.pack("f", 0.0))
fout.write(struct.pack("f", 0.0))
Expand All @@ -121,9 +121,9 @@ def main(args_in: Optional[List[str]] = None) -> None:
fout.write(struct.pack("f", 0.0)) # config.json "rope_scaling.factor", not enabled
fout.write(struct.pack("i", 0)) # rope_scaling.original_max_position_embeddings
fout.write(struct.pack("i", 0)) # params["rope_scaling"]["type"] =="yarn" else 0))
fout.write(struct.pack("i", hparams["bos_token_id"] if hparams["bos_token_id"]
fout.write(struct.pack("i", hparams["bos_token_id"] if hparams["bos_token_id"]
else tokenizer.special_tokens['<|endoftext|>']))
fout.write(struct.pack("i", hparams["eos_token_id"] if hparams["eos_token_id"]
fout.write(struct.pack("i", hparams["eos_token_id"] if hparams["eos_token_id"]
else tokenizer.special_tokens['<|endoftext|>']))
fout.write(struct.pack("i", tokenizer.pad_token_id if tokenizer.pad_token_id is not None else -1))
fout.write(struct.pack("i", tokenizer.sep_token_id if tokenizer.sep_token_id is not None else -1))
Expand Down

0 comments on commit 5fdc7bc

Please sign in to comment.