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 truncate parameter for shortening inputs to match model token length limits #22

Merged
merged 2 commits into from
Apr 23, 2024

Conversation

mattf
Copy link
Collaborator

@mattf mattf commented Apr 15, 2024

options are -

  • "NONE" (default), do not truncate and raise an exception if the input is too long
  • "END", truncate tokens from the right side of the input
  • "START", truncate tokens from the left side of the input

future: consider END/RIGHT/BOTTOM and START/LEFT/TOP aliases for better language support

note: NONE is the default because it is the service's default, most users will pick END

fixes #20

@mattf mattf requested a review from fciannella April 15, 2024 10:53
@mattf mattf self-assigned this Apr 15, 2024
@mattf
Copy link
Collaborator Author

mattf commented Apr 15, 2024

@sduttanv will this address the issue?

@sduttanv
Copy link

Hi @mattf, this solves the issue. Thank you so much!!

mattf added 2 commits April 17, 2024 06:33
…gth limits

options are -
 - "NONE" (default), do not truncate and raise an exception if the input is too long
 - "END", truncate tokens from the right side of the input
 - "START", truncate tokens from the left side of the input

future: consider END/RIGHT/BOTTOM and START/LEFT/TOP aliases for better language support

note: NONE is the default because it is the service's default, most users will pick END
@mattf mattf force-pushed the mattf/add-embedding-truncate branch from 03a4ea7 to cc900e1 Compare April 17, 2024 11:35
@mattf mattf merged commit c4e8a0e into main Apr 23, 2024
12 checks passed
@mattf mattf deleted the mattf/add-embedding-truncate branch April 23, 2024 17:29
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.

Truncation feature
2 participants