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

AWS bedrock Cohere embedding - got error "expected maxLength: 2048" #3942

Open
4 tasks done
kerlion opened this issue Apr 28, 2024 · 1 comment · May be fixed by #4253
Open
4 tasks done

AWS bedrock Cohere embedding - got error "expected maxLength: 2048" #3942

kerlion opened this issue Apr 28, 2024 · 1 comment · May be fixed by #4253
Labels
👻 feat:rag Embedding related issue, like qdrant, weaviate, milvus, vector database.

Comments

@kerlion
Copy link
Contributor

kerlion commented Apr 28, 2024

Self Checks

  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • Pleas do not modify this template :) and fill in all the required fields.

1. Is this request related to a challenge you're experiencing?

Can our embedding model has an property maxLength, similar as context_size. Then split text into chunks by maxLength.

bedrock Cohere embedding: Its "context_size" is 512.
It says: 1 token is about 4 characters, so its limication is 512 tokens.
But it is not true, in fact it can deal with 1024 tokens. Its hard limitation is 2048 characters.
We got the senario: I have 2500 characters, while has only 300 tokens.

expected maxLength: 2048, actual: 2459

2. Describe the feature you'd like to see

Model configuration, choose one property: {maxLength|context_size}, or add a unit {tokens|characters}
Model configuration, enable alternative property: {maxLength|context_size}, or add a property unit {tokens|characters}

3. How will this feature improve your workflow or experience?

to fix cohere error: expected maxLength: 2048

4. Additional context or comments

No response

5. Can you help us with this feature?

  • I am interested in contributing to this feature.
@dosubot dosubot bot added the 👻 feat:rag Embedding related issue, like qdrant, weaviate, milvus, vector database. label Apr 28, 2024
@kerlion
Copy link
Contributor Author

kerlion commented May 7, 2024

I discovered that it is due to the existence of massive semanticless characters, such as consecutive periods or dashes. Is there any way to use Python to remove these meaningless characters? Or is there a way to invoke a pre-configured LLM within the embedding module to remove these meaningless characters? So the max length of text will less than 2048 chars.

@kerlion kerlion linked a pull request May 10, 2024 that will close this issue
14 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
👻 feat:rag Embedding related issue, like qdrant, weaviate, milvus, vector database.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant