eole-nlp / eole

Open language modeling toolkit based on PyTorch
https://eole-nlp.github.io/eole
MIT License
24 stars 6 forks source link

Refactor position encoding configuration #60

Closed vince62s closed 1 week ago

vince62s commented 2 weeks ago

address #17 Now we need to configure "position_encoding_type" which takes the following values:

class PositionEncodingType(str, Enum): SinusoidalInterleaved = "SinusoidalInterleaved" SinusoidalConcat = "SinusoidalConcat" Learned = "Learned" Relative = "Relative" Rotary = "Rotary" Alibi = "Alibi" or None

For the first 3 (absolute position encoding) it will be handled at the Embeddings level.

For the last 3 it is handled in the multi-head-attention

By default it is: SinusoidalInterleaved

If you want no encoding then use None (or null in the config.json)