Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add BART model #6

Merged
merged 34 commits into from
Jul 1, 2022
Merged

Add BART model #6

merged 34 commits into from
Jul 1, 2022

Conversation

seanmor5
Copy link
Contributor

No description provided.

lib/bumblebee/layers.ex Outdated Show resolved Hide resolved
lib/bumblebee/text/bart.ex Outdated Show resolved Hide resolved
lib/bumblebee/text/bart.ex Outdated Show resolved Hide resolved
lib/bumblebee/layers.ex Show resolved Hide resolved
offset_position_ids =
Axon.nx(input_embeds, fn embeds ->
seq_len = Nx.axis_size(embeds, 1)
positions = Nx.iota({seq_len})
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flax supports position_ids as an input on top of that, although pt and tf don't. For BERT however, all of them accept position_ids.

On a related note, flax doesn't accept inputs_embeds as an input, neither for BERT nor BART, perhaps to make things simpler? Is it common to use that?

There may be some inconsistencies between different models/implementations support, so I'm just pointing those out so we can try to make our implementations consistent.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I noticed that as well, I think we should definitely try to standardize around something and support the same inputs per class of model. I think probably more flexibility is better? By accepting inputs_embeds you can choose possibly a different embedding e.g. specify a different initial state, but I don't know how common it is. Accepting position_ids is probably okay too, though I also don't know how common it is

lib/bumblebee/text/bart.ex Outdated Show resolved Hide resolved
lib/bumblebee/text/bart.ex Outdated Show resolved Hide resolved
lib/bumblebee/text/bart.ex Outdated Show resolved Hide resolved
@seanmor5 seanmor5 changed the title Add BART Model Add BART model Jun 26, 2022
lib/bumblebee/layers.ex Outdated Show resolved Hide resolved
lib/bumblebee/layers.ex Outdated Show resolved Hide resolved
lib/bumblebee/text/bart.ex Outdated Show resolved Hide resolved
lib/bumblebee/text/bart.ex Outdated Show resolved Hide resolved
lib/bumblebee/text/bart.ex Outdated Show resolved Hide resolved
seanmor5 and others added 10 commits June 30, 2022 18:31
Co-authored-by: Jonatan Kłosko <jonatanklosko@gmail.com>
Co-authored-by: Jonatan Kłosko <jonatanklosko@gmail.com>
Co-authored-by: Jonatan Kłosko <jonatanklosko@gmail.com>
Co-authored-by: Jonatan Kłosko <jonatanklosko@gmail.com>
Copy link
Member

@jonatanklosko jonatanklosko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fantastic job! :D

@jonatanklosko jonatanklosko merged commit fbacfc1 into main Jul 1, 2022
@jonatanklosko jonatanklosko deleted the sm-bart branch July 1, 2022 11:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants