Skip to content

Adding additional embeddings after the Q and K are projected, but before the RoPE #319

@JavaStudentAlex

Description

@JavaStudentAlex

Hi,
I would like to use your library for implementing some transformer layers. It is nothing hard, just a cross-attention with ffn and also with RoPE. And here is the example of my code:

attention = AttentionLayers(
    dim=64,
    depth=1,
    heads=8,
    cross_attn_dim_head=8,
    cross_attend=True,
    only_cross=True,
    ff_dropout=0.1,
    rotary_pos_emb=True,
    ff_mult=8

But also what I need is to add some additional embeddings(not positional) to the projected Q and K values but before the RoPE is applied. I have carefully checked the forward parameters from the code and till now could not find any option to do it. Could you please guide me.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions