Skip to content

Commit 710a645

Browse files
committed
Support partial rotary embedding for Phi3
1 parent 2dfad85 commit 710a645

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lib/bumblebee/text/phi3.ex

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,10 @@ defmodule Bumblebee.Text.Phi3 do
5151
default: :gelu_approx_tanh,
5252
doc: "the activation function"
5353
],
54+
rotary_embedding_percentage: [
55+
default: 1.0,
56+
doc: "percentage of hidden dimensions to allocate to rotary embeddings"
57+
],
5458
rotary_embedding_base: [
5559
default: 10_000,
5660
doc: "base for computing rotary embedding frequency"
@@ -375,6 +379,7 @@ defmodule Bumblebee.Text.Phi3 do
375379
position_ids: position_ids,
376380
max_positions: spec.max_positions,
377381
base: spec.rotary_embedding_base,
382+
percentage: spec.rotary_embedding_percentage,
378383
scaling_strategy: spec.rotary_embedding_scaling_strategy
379384
],
380385
query_use_bias: false,
@@ -453,6 +458,7 @@ defmodule Bumblebee.Text.Phi3 do
453458
attention_window_size: {"sliding_window", optional(number())},
454459
intermediate_size: {"intermediate_size", number()},
455460
activation: {"hidden_act", activation()},
461+
rotary_embedding_percentage: {"partial_rotary_factor", number()},
456462
rotary_embedding_base: {"rope_theta", number()},
457463
rotary_embedding_scaling_strategy:
458464
{"rope_scaling", optional(scaling_strategy_converter)},

0 commit comments

Comments
 (0)