lancedb / lancedb

Developer-friendly, serverless vector database for AI applications. Easily add long-term memory to your LLM apps!
https://lancedb.github.io/lancedb/
Apache License 2.0
4.55k stars 317 forks source link

bug(python): Watsonx integration in Embedding API #1535

Open PrashantDixit0 opened 2 months ago

PrashantDixit0 commented 2 months ago

LanceDB version

No response

What happened?

While using Watsonx models through Embedding API throwing error

WARNING:root:Error occurred: Failure during generate. (POST https://us-south.ml.cloud.ibm.com/ml/v1/text/embeddings?version=2024-07-29)

using the same credentials following official documentation of IBM watson, it is working https://ibm.github.io/watsonx-ai-python-sdk/fm_embeddings.html

Are there known steps to reproduce?

Using following code for creating table and using embeddings of watson

import os
import lancedb
from lancedb.pydantic import LanceModel, Vector
from lancedb.embeddings import EmbeddingFunctionRegistry

watsonx_embed = EmbeddingFunctionRegistry.get_instance().get("watsonx").create(
    name="ibm/slate-125m-english-rtrvr",
    api_key="API_KEY",
    project_id="PROJECT_ID",
    url = "https://us-south.ml.cloud.ibm.com"
  )
class TextModel(LanceModel):
    text: str = watsonx_embed.SourceField()
    vector: Vector(watsonx_embed.ndims()) = watsonx_embed.VectorField()
AyushExel commented 2 months ago

Hey @h0rv can you take a look at this one? Thanks!

h0rv commented 1 month ago

Hi @PrashantDixit0, are you able to see the error returned from the watsonx.ai API?

PrashantDixit0 commented 1 month ago

This Error I got while using it with LanceDB Embedding API, Error occurred: Failure during generate. (POST https://us-south.ml.cloud.ibm.com/ml/v1/text/embeddings?version=2024-07-29)

h0rv commented 1 month ago

Is there no other logs? Also, are your watsonx credentials up to date and valid?

PrashantDixit0 commented 1 month ago

I used the same credentials following the official documentation of IBM Watson, it is working https://ibm.github.io/watsonx-ai-python-sdk/fm_embeddings.html

There are the main error logs which I got