Skip to content

Conversation

@shobhit9957
Copy link

Hey Joan, I've done it, according to the issue. I hope it was correct! Thanks for helping Joan.

@JoanFM
Copy link
Member

JoanFM commented Aug 24, 2023

Hey @shobhit9957,

Sorry for the missunderstanding, this is correct, but you will need to implement the private method.

@shobhit9957
Copy link
Author

Can you please elaborate on that meaning private method..., how can I do that in private method

@shobhit9957
Copy link
Author

shobhit9957 commented Aug 24, 2023

hey joan, once check this :

def num_docs(self) -> int:
    """
    Get the number of documents.
    """
    if self._num_docs == 0:
        # Replace the old method with the new one
        self._num_docs = self._get_num_docs_hnsw()
    return self._num_docs

def _get_num_docs_hnsw(self) -> int:
    """
    Get the number of documents using the HNSW method.
    This method should return the count of documents using the new technique.
    """
    # Implement your logic here to get the count using the HNSW method
    # For example, you might access some data or perform calculations
    # that help you quickly determine the number of documents.
    # Then return the count.
    return calculated_num_docs

is this correct?

@JoanFM
Copy link
Member

JoanFM commented Aug 24, 2023

hey joan, once check this :

def num_docs(self) -> int:
    """
    Get the number of documents.
    """
    if self._num_docs == 0:
        # Replace the old method with the new one
        self._num_docs = self._get_num_docs_hnsw()
    return self._num_docs

def _get_num_docs_hnsw(self) -> int:
    """
    Get the number of documents using the HNSW method.
    This method should return the count of documents using the new technique.
    """
    # Implement your logic here to get the count using the HNSW method
    # For example, you might access some data or perform calculations
    # that help you quickly determine the number of documents.
    # Then return the count.
    return calculated_num_docs

is this correct?

Yes, and this computation shpuld come from inside the hnsw indices

shobhit9957 added a commit to shobhit9957/docarray that referenced this pull request Aug 25, 2023
shobhit9957 added a commit to shobhit9957/docarray that referenced this pull request Aug 25, 2023
shobhit9957 added a commit to shobhit9957/docarray that referenced this pull request Aug 25, 2023
@JoanFM JoanFM closed this Sep 20, 2023
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 this pull request may close these issues.

2 participants