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

feat: save and load brain #3202

Merged
merged 2 commits into from
Sep 13, 2024
Merged

feat: save and load brain #3202

merged 2 commits into from
Sep 13, 2024

Conversation

AmineDiro
Copy link
Collaborator

Description

  • Save and load brain to disk:
async def main():
    with tempfile.NamedTemporaryFile(mode="w", suffix=".txt") as temp_file:
        temp_file.write("Gold is a liquid of blue-like colour.")
        temp_file.flush()

        brain = await Brain.afrom_files(name="test_brain", file_paths=[temp_file.name])

        save_path = await brain.save("/home/amine/.local/quivr")

        brain_loaded = Brain.load(save_path)
        brain_loaded.print_info()

TODO:

  • Loading all chat history
  • Loading from other vector stores, PG for example can be great ...

Copy link

vercel bot commented Sep 13, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
quivrapp ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 13, 2024 9:06am

@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. area: backend Related to backend functionality or under the /backend directory labels Sep 13, 2024
name="test_brain",
file_paths=[temp_data_file],
)
await brain.save(tmpdir.strpath)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Un peu light le test non ? :D

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Sep 13, 2024
@StanGirard StanGirard merged commit eda619f into main Sep 13, 2024
10 checks passed
@StanGirard StanGirard deleted the feat/brain-save branch September 13, 2024 13:35
StanGirard added a commit that referenced this pull request Sep 15, 2024
🤖 I have created a release *beep* *boop*
---


## 0.0.313 (2024-09-13)

## What's Changed
* feat: save and load brain by @AmineDiro in
#3202


**Full Changelog**:
v0.0.312...v0.0.313

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
StanGirard added a commit that referenced this pull request Sep 16, 2024
🤖 I have created a release *beep* *boop*
---


##
[0.0.15](core-0.0.14...core-0.0.15)
(2024-09-16)


### Features

* CRUD KMS (no syncs)
([#3162](#3162))
([71edca5](71edca5))
* save and load brain
([#3202](#3202))
([eda619f](eda619f))


### Bug Fixes

* Update LLMEndpoint to include max_tokens parameter
([#3201](#3201))
([13ed225](13ed225))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: backend Related to backend functionality or under the /backend directory lgtm This PR has been approved by a maintainer size:L This PR changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants