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

Truncate inputs larger than context window instead of crashing #9

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ochafik
Copy link
Contributor

@ochafik ochafik commented Nov 17, 2024

This should "fix" #7

Not sure this is doing the right thing tbh, feedback welcome:

  • Currently silently truncating the input. Making truncation optional (and exploding if the option isn't set) runs the risk of most people never using the option and randomly exploding when they finally use larger inputs (in prod).
  • Aligned n_batch = n_ubatch = n_ctx to avoid crashes in llama.cpp. Possibly very inefficient? Also, default to the model's n_ctx_train.

Tested w/ all-MiniLM-L6-v2.e4ce9877.q8_0.gguf & nomic-embed-text-v1.5.Q8_0.gguf.

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.

1 participant