Skip to content

Bug: failed at exact same second call. the first time is ok #570

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

Open
2 of 3 tasks
I-E-E-E opened this issue Feb 17, 2025 · 0 comments
Open
2 of 3 tasks

Bug: failed at exact same second call. the first time is ok #570

I-E-E-E opened this issue Feb 17, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@I-E-E-E
Copy link

I-E-E-E commented Feb 17, 2025

Describe the bug

python: malloc.c:4122: _int_malloc: Assertion `chunk_main_arena (fwd)' failed.
Aborted (core dumped)

Steps to reproduce

@server
def get_user_profiles(query: str, top_k: int = 5):
print(f"get_user_profiles: {query}")
global user_profile_index
# import pdb;pdb.set_trace()
print(f"get_user_profiles: {query}")
queries = [query]
query_embeddings = model.encode(queries, normalize_embeddings=True)
logger.info(f"query_embeddings: {query_embeddings}")
results, search_time, corpus_index = semantic_search_usearch(
query_embeddings,
corpus_index=user_profile_index,
corpus_embeddings=corpus_embeddings if user_profile_index is None else None,
corpus_precision=corpus_precision,
top_k=top_k,
calibration_embeddings=full_corpus_embeddings,
rescore=corpus_precision != "float32",
rescore_multiplier=4,
exact=True,
output_index=True,
)
# import pdb;pdb.set_trace()
# print(f"query_embeddings: {query_embeddings}")
del query_embeddings

for query, result in zip(queries, results):
    print(f"Query: {query}")
    user_profiles = []
    for entry in result:
        score = entry['score']
        corpus_id = entry['corpus_id']
        # text = corpus[corpus_id]
        # print(f"(Score: {score:.4f}) {text}")
        logger.info(f"corpus_id: {corpus_id}")
        with duckdb.connect("duckdb.db") as con:
            df = con.sql(f"select *  from user_profile offset {corpus_id} limit 1").df()
        logger.info(f"df: {df}")
        user_profile = df['user'].values[0]
        logger.info(f"user_profile: {user_profile}")
        user_profiles.append(user_profile)
return user_profiles

Expected behavior

return the same

USearch version

v0.4.0

Operating System

22.04

Hardware architecture

x86

Which interface are you using?

Python bindings

Contact Details

No response

Are you open to being tagged as a contributor?

  • I am open to being mentioned in the project .git history as a contributor

Is there an existing issue for this?

  • I have searched the existing issues

Code of Conduct

  • I agree to follow this project's Code of Conduct
@I-E-E-E I-E-E-E added the bug Something isn't working label Feb 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant