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

Do llama.cpp support input_embeds? #9630

Closed
OswaldoBornemann opened this issue Sep 24, 2024 · 4 comments
Closed

Do llama.cpp support input_embeds? #9630

OswaldoBornemann opened this issue Sep 24, 2024 · 4 comments
Labels
bug-unconfirmed low severity Used to report low severity bugs in llama.cpp (e.g. cosmetic issues, non critical UI glitches) stale

Comments

@OswaldoBornemann
Copy link

OswaldoBornemann commented Sep 24, 2024

Do llama.cpp support input_embeds? Just like transformers support input_embeds in model.generate function.

@OswaldoBornemann OswaldoBornemann added bug-unconfirmed low severity Used to report low severity bugs in llama.cpp (e.g. cosmetic issues, non critical UI glitches) labels Sep 24, 2024
@ggerganov
Copy link
Owner

Probably llama_batch.embd is what you are looking for:

float * embd;

@OswaldoBornemann
Copy link
Author

Yeah that's great. In my case, the input is only the input_embeds instead of tokens. So you mean llama.cpp already supported it?

@ggerganov
Copy link
Owner

ggerganov commented Sep 24, 2024

Yes, you can pass NULL for token and then put the token embeddings directly via the embd pointer. It should point to n_tokens*n_embd floats

@github-actions github-actions bot added the stale label Oct 25, 2024
Copy link
Contributor

github-actions bot commented Nov 9, 2024

This issue was closed because it has been inactive for 14 days since being marked as stale.

@github-actions github-actions bot closed this as completed Nov 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug-unconfirmed low severity Used to report low severity bugs in llama.cpp (e.g. cosmetic issues, non critical UI glitches) stale
Projects
None yet
Development

No branches or pull requests

2 participants