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

Support input embedding size more than 8K token #87

Closed
rodrigomeireles opened this issue Nov 22, 2024 · 6 comments
Closed

Support input embedding size more than 8K token #87

rodrigomeireles opened this issue Nov 22, 2024 · 6 comments
Assignees
Labels
enhancement New feature or request

Comments

@rodrigomeireles
Copy link

rodrigomeireles commented Nov 22, 2024

Big files seem to reach the 8k context of text-embedding-3-small using Open AI. There should probably be a chunking/retrieval strategy implementation for this.

@rodrigomeireles
Copy link
Author

Example:

read the TODO file
embedding request failed with status code '400' - This model's maximum context length is 8192 tokens, however you requested 11514 tokens (11514 in your prompt; 0 for the completion). Please reduce your prompt; or completion length.

┌────────────────────────────────────────────────────────────────────────────────┐
│ Token Used: 0 - Cost: 0.000000 $ - Chat Model: gpt-4o │
│ Token Used: 55035 - Cost: 0.000106 $ - Embedding Model: text-embedding-3-small │
└────────────────────────────────────────────────────────────────────────────────┘

I think this is just the initial embedding of the whole project because the TODO file itself is very very small.

@meysamhadeli
Copy link
Owner

Thanks for reporting the issue. each embed for each file send a request asynchronous to AI now. for example here one of your file is need more than 8K token!? base on your input "read the TODO file" RAG try to find similar files and one of these files seems is more that 8k! Do you have any experience about chunk or batch in embedding!?

@meysamhadeli meysamhadeli added the enhancement New feature or request label Nov 22, 2024
@meysamhadeli meysamhadeli changed the title The project doesn't work for big files. Support input embedding size more than 8K token Nov 22, 2024
@rodrigomeireles
Copy link
Author

Thanks for reporting the issue. each embed for each file send a request asynchronous to AI now. for example here one of your file is need more than 8K token!? base on your input "read the TODO file" RAG try to find similar files and one of these files seems is more that 8k! Do you have any experience about chunk or batch in embedding!?

I do have experience in chunking and batch embeddings. Why do you ask?
Maybe it's getting context from undesired files? Is it respecting .gitignore? .dockerignore? Is there a command to debug the call to the embeddings API?

@meysamhadeli
Copy link
Owner

Thanks for reporting the issue. each embed for each file send a request asynchronous to AI now. for example here one of your file is need more than 8K token!? base on your input "read the TODO file" RAG try to find similar files and one of these files seems is more that 8k! Do you have any experience about chunk or batch in embedding!?

I do have experience in chunking and batch embeddings. Why do you ask? Maybe it's getting context from undesired files? Is it respecting .gitignore? .dockerignore? Is there a command to debug the call to the embeddings API?

If you have some experience and have time, feel free to add this enhancement, otherwise I will work on that and fix this issue.
Yes, project handle .gitignore properly but .dockerignore not yet. also I think you get undesired files maybe! there is no separate command for calling embedding api separately. if you wanna check it you can fork the project and debug it.

@meysamhadeli
Copy link
Owner

Thanks for reporting the issue. each embed for each file send a request asynchronous to AI now. for example here one of your file is need more than 8K token!? base on your input "read the TODO file" RAG try to find similar files and one of these files seems is more that 8k! Do you have any experience about chunk or batch in embedding!?

I do have experience in chunking and batch embeddings. Why do you ask? Maybe it's getting context from undesired files? Is it respecting .gitignore? .dockerignore? Is there a command to debug the call to the embeddings API?

@rodrigomeireles Problem solved in this version v1.7.4.

Also, now you can use .codai-gitignore in root of your directory beside of config for ignore unnecessary files like image.

Please check it out.

@meysamhadeli meysamhadeli self-assigned this Nov 26, 2024
@meysamhadeli
Copy link
Owner

This issue is fixed in PR #88, and I closed this issue. if there is any other issue related to that, create a new issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants