-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a script for downloading the embeddings cache easily
- Loading branch information
Vita Midori
committed
Dec 2, 2024
1 parent
2aa651d
commit 3127e5a
Showing
4 changed files
with
45 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
"""Run this script with `uv run data/embeddings-cache/download.py` to download embeddings caches from Exoscale. | ||
This overwrites your local cache! | ||
""" | ||
|
||
import logging | ||
import pathlib | ||
import sys | ||
|
||
import dotenv | ||
|
||
CACHE_FILES = ("openai--text-embedding-3-large.parquet",) | ||
|
||
CACHE_DIRECTORY = pathlib.Path(__file__).parent | ||
REPOSITORY_ROOT = (CACHE_DIRECTORY / ".." / "..").resolve() | ||
|
||
sys.path.append(str(REPOSITORY_ROOT)) | ||
|
||
import research.lib.data_access # noqa: E402 | ||
|
||
if __name__ == "__main__": | ||
logging.basicConfig(level=logging.INFO) | ||
dotenv.load_dotenv() | ||
for cache_file in CACHE_FILES: | ||
research.lib.data_access.download_file_from_exoscale( | ||
remote_path=pathlib.Path("tmp") / "embeddings-cache" / cache_file, | ||
local_path=CACHE_DIRECTORY / cache_file, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters