wdoppenberg / polars-candle

A text embedding extension for the Polars Dataframe library.
22 stars 0 forks source link

Unable to load model using bert-base-uncased #13

Open mondjef opened 3 months ago

mondjef commented 3 months ago
df = pl.DataFrame({"s": ["This is a sentence", "This is another sentence"]})

df.with_columns(
    pl.col("s").candle.embed_text("bert-base-uncased").alias('s_embedding')
    )
print(df)

results in the following trace

Traceback (most recent call last):

  Cell In[9], line 1
    df.with_columns(

  File ~\AppData\Roaming\Python\Python310\site-packages\polars\dataframe\frame.py:8242 in with_columns
    return self.lazy().with_columns(*exprs, **named_exprs).collect(_eager=True)

  File ~\AppData\Roaming\Python\Python310\site-packages\polars\lazyframe\frame.py:1816 in collect
    return wrap_df(ldf.collect(callback))

ComputeError: the plugin failed with message: Failed to load model: Invalid model architecture: Invalid model architecture

Any idea what I am doing wrong or what the issues is? Probably something I am doing or not doing as I am fairly new to these models and Polars.

Edit: I can use the snowflake model example in the readme example as-is without issue.

wdoppenberg commented 3 months ago

I can reproduce your error and will look into it. This is due to the configuration parsing logic, which needs to be fixed/improved in the upstream glowrs library.