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 assertion informing the API user about missing llama_encode() call #8400

Merged
merged 1 commit into from
Jul 10, 2024

Conversation

fairydreaming
Copy link
Collaborator

Using encoder-decoder models like T5 without calling llama_encode() first currently results in a cryptic error message:

GGML_ASSERT: ggml/src/ggml.c:5278: !ggml_is_transposed(a)

that is already causing confusion: #8398.

This PR adds an assertion to build_t5() that informs the API user about the necessity of calling llama_encode() first if there are no encoder outputs present during llama_decode(). With this PR the error message is:

GGML_ASSERT: src/llama.cpp:13203: n_outputs_enc > 0 && "call llama_encode() first"

@ggerganov ggerganov merged commit a8be1e6 into ggerganov:master Jul 10, 2024
53 checks passed
Nexesenex pushed a commit to Nexesenex/croco.cpp that referenced this pull request Jul 11, 2024
arthw pushed a commit to arthw/llama.cpp that referenced this pull request Jul 13, 2024
arthw pushed a commit to arthw/llama.cpp that referenced this pull request Jul 13, 2024
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.

3 participants