You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I connect to a local LMStudio server to create embeddings the call sends an array of tokens to /v1/embeddings
LMStudio accepts only an array of strings. Otherwise it will throw this error: 'input' field must be a string or an array of strings
Workaround:
I was able to create that behaviour by editing the call to OpenAIEmbeddings() in config.py.
Currently it looks like this: return OpenAIEmbeddings( model=model, api_key=RAG_OPENAI_API_KEY, openai_api_base=RAG_OPENAI_BASEURL, openai_proxy=RAG_OPENAI_PROXY, )
If I add the parameter "check_embedding_ctx_length=False"
Current situation:
When I connect to a local LMStudio server to create embeddings the call sends an array of tokens to /v1/embeddings
LMStudio accepts only an array of strings. Otherwise it will throw this error: 'input' field must be a string or an array of strings
Workaround:
I was able to create that behaviour by editing the call to OpenAIEmbeddings() in config.py.
Currently it looks like this:
return OpenAIEmbeddings( model=model, api_key=RAG_OPENAI_API_KEY, openai_api_base=RAG_OPENAI_BASEURL, openai_proxy=RAG_OPENAI_PROXY, )
If I add the parameter "check_embedding_ctx_length=False"
return OpenAIEmbeddings( check_embedding_ctx_length=False, model=model, api_key=RAG_OPENAI_API_KEY, openai_api_base=RAG_OPENAI_BASEURL, openai_proxy=RAG_OPENAI_PROXY, )
It will work with LMStudio.
Proposal:
I propose to add an environment variable to be able to switch to this behaviour.
The text was updated successfully, but these errors were encountered: