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

some kind of weird error regarding float32 I never got before upgrading #2127

Closed
BBC-Esq opened this issue Jan 3, 2025 · 3 comments · Fixed by #2128
Closed

some kind of weird error regarding float32 I never got before upgrading #2127

BBC-Esq opened this issue Jan 3, 2025 · 3 comments · Fixed by #2128
Assignees

Comments

@BBC-Esq
Copy link

BBC-Esq commented Jan 3, 2025

Below I paste a weird error I get when upgrading from 0.33 to 0.33.1. Not sure if it matters, but I also have installed the following for my vector database program:

1 - tiledb-cloud==0.13.0
2 - tiledb-vector-search==0.11.0
3 - tblib==1.7.0
4 - numpy==1.26.4

LONG ERROR HERE EXPAND DOWNWARDS
Traceback (most recent call last):
  File "C:\Users\Airflow\AppData\Local\Programs\Python\Python311\Lib\multiprocessing\process.py", line 314, in _bootstrap
    self.run()
  File "C:\Users\Airflow\AppData\Local\Programs\Python\Python311\Lib\multiprocessing\process.py", line 108, in run
    self._target(self._args, **self._kwargs)
  File "D:\Scripts\VectorDB-Plugin-for-LM-Studio\working\database_interactions.py", line 29, in create_vector_db_in_process
    create_vector_db.run()
  File "D:\Scripts\VectorDB-Plugin-for-LM-Studio\working\Lib\site-packages\torch\utils\_contextlib.py", line 116, in decorate_context
    return func(args, kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "D:\Scripts\VectorDB-Plugin-for-LM-Studio\working\database_interactions.py", line 398, in run
    self.create_database(texts, embeddings)
  File "D:\Scripts\VectorDB-Plugin-for-LM-Studio\working\Lib\site-packages\torch\utils\_contextlib.py", line 116, in decorate_context
    return func(*args, kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "D:\Scripts\VectorDB-Plugin-for-LM-Studio\working\database_interactions.py", line 246, in create_database
    db = TileDB.from_texts(
         ^^^^^^^^^^^^^^^^^^
  File "D:\Scripts\VectorDB-Plugin-for-LM-Studio\working\Lib\site-packages\langchain_community\vectorstores\tiledb.py", line 726, in from_texts
    return cls.from(
           ^^^^^^^^^^^
  File "D:\Scripts\VectorDB-Plugin-for-LM-Studio\working\Lib\site-packages\langchain_community\vectorstores\tiledb.py", line 578, in from
    tiledb_vs.ingestion.ingest(
  File "D:\Scripts\VectorDB-Plugin-for-LM-Studio\working\Lib\site-packages\tiledb\vector_search\ingestion.py", line 3302, in ingest
    source_uri = write_input_vectors(
                 ^^^^^^^^^^^^^^^^^^^^
  File "D:\Scripts\VectorDB-Plugin-for-LM-Studio\working\Lib\site-packages\tiledb\vector_search\ingestion.py", line 549, in write_input_vectors
    input_vectors_array[:, :] = np.transpose(input_vectors)
    ~~~~~~~~~~~~~~~~~~~^^^^^^
  File "D:\Scripts\VectorDB-Plugin-for-LM-Studio\working\Lib\site-packages\tiledb\dense_array.py", line 383, in setitem
    self._setitem_impl(selection, val, dict())
  File "D:\Scripts\VectorDB-Plugin-for-LM-Studio\working\Lib\site-packages\tiledb\dense_array.py", line 578, in setitemimpl
    self._write_array(subarray, [], attributes, values, labels, nullmaps, False)
  File "D:\Scripts\VectorDB-Plugin-for-LM-Studio\working\Lib\site-packages\tiledb\array.py", line 899, in writearray
    q.set_data_buffer(
TypeError: set_data_buffer(): incompatible function arguments. The following argument types are supported:
    1. (self: tiledb.libtiledb.Query, arg0: str, arg1: numpy.ndarray, arg2: int) -> None
Invoked with: <tiledb.libtiledb.Query object at 0x000002C91121C430>, 'values', array([[-0.01574707,  0.01733398, -0.00946045, ...,  0.01116943,
        -0.04248047, -0.02770996],
       [-0.0267334 , -0.00769043, -0.02185059, ..., -0.03613281,
        -0.01495361,  0.00601196],
       [ 0.03662109,  0.02441406,  0.06347656, ...,  0.05664062,
         0.01556396,  0.00430298],
       ...,
       [-0.01501465, -0.02563477, -0.04370117, ..., -0.05200195,
        -0.01147461, -0.02404785],
       [-0.12451172, -0.13378906, -0.0859375 , ..., -0.08447266,
        -0.13085938, -0.12792969],
       [ 0.02819824,  0.02331543,  0.07714844, ...,  0.02478027,
         0.03271484,  0.02355957]], dtype=float32), 31104.0

I can verify that downgrading to 0.33 makes it work again.

@kounelisagis
Copy link
Member

Hello and thank you for opening the issue.

Could you share a code snippet to check that the PR fixes your issue?

@BBC-Esq
Copy link
Author

BBC-Esq commented Jan 3, 2025

All the the scripts mentioned in the traceback are brand spanking new in this release and can be reviewed on my repository here:

https://github.com/BBC-Esq/VectorDB-Plugin-for-LM-Studio

Also, not sure if it matters but at the time of the error I was running the relatively new "granite" embedding model located here, which is natively in bfloat16:

https://huggingface.co/ibm-granite/granite-embedding-30m-english

@BBC-Esq BBC-Esq changed the title some kind of weird error regarding float32 I neve got before upgrading some kind of weird error regarding float32 I never got before upgrading Jan 3, 2025
@ihnorton
Copy link
Member

ihnorton commented Jan 5, 2025

We just released 0.33.2 with a fix for this issue; wheels should be up on PyPI shortly.

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 a pull request may close this issue.

3 participants