Skip to content

feat: save and load inmemory index#1534

Merged
jupyterjazz merged 9 commits into
mainfrom
feat-save-inmemory
May 15, 2023
Merged

feat: save and load inmemory index#1534
jupyterjazz merged 9 commits into
mainfrom
feat-save-inmemory

Conversation

@jupyterjazz

@jupyterjazz jupyterjazz commented May 15, 2023

Copy link
Copy Markdown
Contributor

Closes #1535

Signed-off-by: jupyterjazz <saba.sturua@jina.ai>
Signed-off-by: jupyterjazz <saba.sturua@jina.ai>

@JoanFM JoanFM left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please edit documentation

Signed-off-by: jupyterjazz <saba.sturua@jina.ai>
Signed-off-by: jupyterjazz <saba.sturua@jina.ai>
Signed-off-by: jupyterjazz <saba.sturua@jina.ai>
Signed-off-by: jupyterjazz <saba.sturua@jina.ai>
Signed-off-by: jupyterjazz <saba.sturua@jina.ai>
@JoanFM

JoanFM commented May 15, 2023

Copy link
Copy Markdown
Member

I would like to have this also for hnsw one? or it already behaves like this?

@jupyterjazz

Copy link
Copy Markdown
Contributor Author

@JoanFM hnsw's already cool, it updates index after each change and can load from existing workdir

@JoanFM

JoanFM commented May 15, 2023

Copy link
Copy Markdown
Member

@jupyterjazz should we adapt the LangChain integration?

@JoanFM JoanFM left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we rename the method? I believe binary provides no value here.

WDYT @samsja @jupyterjazz @JohannesMessner ?

Comment thread docarray/index/backends/in_memory.py Outdated
) -> _FindResultBatched:
raise NotImplementedError(f'{type(self)} does not support text search.')

def save_binary(self, file: str = 'in_memory_index.bin') -> None:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
def save_binary(self, file: str = 'in_memory_index.bin') -> None:
def persist(self, file: str = 'in_memory_index.bin') -> None:

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agree

Signed-off-by: jupyterjazz <saba.sturua@jina.ai>
@jupyterjazz

Copy link
Copy Markdown
Contributor Author

@jupyterjazz should we adapt the LangChain integration?

langchain doesn't need loading from a binary file

@jupyterjazz jupyterjazz merged commit db4cc1a into main May 15, 2023
@jupyterjazz jupyterjazz deleted the feat-save-inmemory branch May 15, 2023 09:06
@github-actions

Copy link
Copy Markdown

📝 Docs are deployed on https://ft-feat-save-inmemory--jina-docs.netlify.app 🎉

@samsja samsja mentioned this pull request May 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Save/load for InMemory index

3 participants