Skip to content

Commit

Permalink
Command line argument to override rope_theta from config.json
Browse files Browse the repository at this point in the history
  • Loading branch information
turboderp committed Sep 1, 2023
1 parent b7f3fac commit a544085
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions model_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ def add_args(parser):
parser.add_argument("-l", "--length", type = int, help = "Maximum sequence length", default = 2048)
parser.add_argument("-cpe", "--compress_pos_emb", type = float, help = "Compression factor for positional embeddings", default = 1.0)
parser.add_argument("-a", "--alpha", type = float, help = "alpha for context size extension via embedding extension", default = 1.0)
parser.add_argument("-theta", "--theta", type = float, help = "theta (base) for RoPE embeddings")

parser.add_argument("-gpfix", "--gpu_peer_fix", action = "store_true", help = "Prevent direct copies of data between GPUs")

Expand Down Expand Up @@ -140,6 +141,9 @@ def make_config(args):
config.silu_no_half2 = args.silu_no_half2
config.concurrent_streams = args.concurrent_streams

if args.theta:
config.rotary_embedding_base = args.theta

return config


Expand Down

0 comments on commit a544085

Please sign in to comment.