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

.Net: Bug: Using WithOpenAITextEmbeddingGeneration() with locally hosted model gives error "The input is not a valid Base64 string of encoded floats." #8833

Open
ChiragSoni95 opened this issue Sep 17, 2024 · 0 comments
Assignees
Labels
bug Something isn't working .NET Issue or Pull requests regarding .NET code

Comments

@ChiragSoni95
Copy link

ChiragSoni95 commented Sep 17, 2024

Describe the bug
using WithOpenAITextEmbeddingGeneration(), I get the error "The input is not a valid Base64 string of encoded floats." in semantic kernel gives "The input is not a valid Base64 string of encoded floats."

To Reproduce
Steps to reproduce the behavior:

  • See usage and error screenshots below

Expected behavior
Successfully get embedding and add to the MemoryStore

Screenshots

image
image
image

Platform

  • OS: Windows
  • IDE: VSCode
  • Language: C#

Additional context
I am using LMStudio for hosting a local embedding model, the precision value of floating point is different than what AzureOpenAIAPI has, see below: is that causing issue using above code?

AzureOpenAI API Embedding Output: This works fine with volatile memory store

{"object": "embedding", "index": 0, "embedding": [ -0.012779145, -0.0075187064, -0.017534792, -0.028241644, -0.018796766,
...
}

LM Studio Embedding model output:
{ "object": "embedding", "embedding": [ 0.04841502383351326, 0.026464618742465973, -0.17441967129707336, -0.03099326603114605,
...
}

Format of the output JSON is exactly same except the precision of floating points.

@ChiragSoni95 ChiragSoni95 added the bug Something isn't working label Sep 17, 2024
@markwallace-microsoft markwallace-microsoft added .NET Issue or Pull requests regarding .NET code triage labels Sep 17, 2024
@github-actions github-actions bot changed the title Bug: When using WithOpenAITextEmbeddingGeneration(), I get the error "The input is not a valid Base64 string of encoded floats." .Net: Bug: When using WithOpenAITextEmbeddingGeneration(), I get the error "The input is not a valid Base64 string of encoded floats." Sep 17, 2024
@markwallace-microsoft markwallace-microsoft self-assigned this Sep 17, 2024
@ChiragSoni95 ChiragSoni95 changed the title .Net: Bug: When using WithOpenAITextEmbeddingGeneration(), I get the error "The input is not a valid Base64 string of encoded floats." .Net: Bug: When using WithOpenAITextEmbeddingGeneration() with locally hosted model, I get the error "The input is not a valid Base64 string of encoded floats." Sep 18, 2024
@ChiragSoni95 ChiragSoni95 changed the title .Net: Bug: When using WithOpenAITextEmbeddingGeneration() with locally hosted model, I get the error "The input is not a valid Base64 string of encoded floats." .Net: Bug: Using WithOpenAITextEmbeddingGeneration() with locally hosted model gives error "The input is not a valid Base64 string of encoded floats." Sep 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working .NET Issue or Pull requests regarding .NET code
Projects
Status: Bug
Development

No branches or pull requests

2 participants