θΏ™ζ˜―indexlocζδΎ›ηš„ζœεŠ‘οΌŒδΈθ¦θΎ“ε…₯任何密码
Skip to content

Conversation

@louishalbritter
Copy link

Pull Request Type

  • ✨ feat
  • πŸ› fix
  • ♻️ refactor
  • πŸ’„ style
  • πŸ”¨ chore
  • πŸ“ docs

Relevant Issues

resolves #3069

What is in this change?

The function tokenizeString is very CPU-intensive. Its only use I found is here to estimate embedding costs for OpenAI:

// Do not do cost estimation unless the embedding engine is OpenAi.
if (systemSettings?.EmbeddingEngine === "openai") {

When run against a local LLM provider, this function isn’t necessary, thus saving significant time and energy.

Additional Information

Developer Validations

  • I ran yarn lint from the root of the repo & committed changes
  • Relevant documentation has been updated
  • I have tested my code functionality
  • Docker build succeeds locally

@timothycarambat
Copy link
Member

Moving to #3072

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.

[BUG]: performance - tokenizeString runs unnecessary when EMBEDDING_ENGINE is not β€˜openai’

2 participants