-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add boilerplace code for feature pipelines
- Loading branch information
1 parent
70ea182
commit c4d7849
Showing
21 changed files
with
191 additions
and
55 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
# ruff | ||
# Ruff | ||
.ruff_cache | ||
|
||
# Byte-compiled / optimized / DLL files | ||
__pycache__/ | ||
*.py[cod] | ||
|
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 |
---|---|---|
|
@@ -29,6 +29,7 @@ make_me_laugh | |
make local-infrastructure-up | ||
``` | ||
|
||
|
||
### Run ZenML pipelines | ||
|
||
```bash | ||
|
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 @@ | ||
parameters: |
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 @@ | ||
parameters: |
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 |
---|---|---|
@@ -1,7 +1,6 @@ | ||
from .collect_notion_data import collect_notion_data | ||
from .compute_rag_vector_index import compute_rag_vector_index | ||
from .etl import etl | ||
from .generate_dataset import generate_dataset | ||
|
||
__all__ = [ | ||
"collect_notion_data", | ||
"etl" | ||
] | ||
__all__ = ["collect_notion_data", "etl", "generate_dataset", "compute_rag_vector_index"] |
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,18 @@ | ||
from zenml import pipeline | ||
|
||
from second_brain.config import settings | ||
from steps.infrastructure import ( | ||
fetch_from_mongodb, | ||
) | ||
|
||
|
||
@pipeline | ||
def compute_rag_vector_index() -> None: | ||
fetch_documents_config = { | ||
"mongodb_uri": settings.MONGODB_OFFLINE_URI, | ||
"database_name": settings.MONGODB_OFFLINE_DATABASE, | ||
"collection_name": settings.MONGODB_OFFLINE_COLLECTION, | ||
"limit": 100, | ||
} | ||
|
||
fetch_from_mongodb(**fetch_documents_config) |
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 |
---|---|---|
@@ -1,26 +1,27 @@ | ||
from zenml import pipeline | ||
|
||
from second_brain.config import settings | ||
from steps.infrastructure import ( | ||
ingest_to_mongodb, | ||
fetch_from_mongodb, | ||
ingest_to_mongodb, | ||
) | ||
|
||
from second_brain.config import settings | ||
|
||
@pipeline | ||
def etl() -> None: | ||
ingest_json_config= { | ||
"mongodb_uri": settings.MONGODB_OFFLINE_URI, | ||
"database_name": settings.MONGODB_OFFLINE_DATABASE, | ||
"collection_name": settings.MONGODB_OFFLINE_COLLECTION, | ||
"data_directory": settings.DATA_DIRECTORY, | ||
} | ||
ingest_json_config = { | ||
"mongodb_uri": settings.MONGODB_OFFLINE_URI, | ||
"database_name": settings.MONGODB_OFFLINE_DATABASE, | ||
"collection_name": settings.MONGODB_OFFLINE_COLLECTION, | ||
"data_directory": settings.DATA_DIRECTORY, | ||
} | ||
fetch_documents_config = { | ||
"mongodb_uri": settings.MONGODB_OFFLINE_URI, | ||
"database_name": settings.MONGODB_OFFLINE_DATABASE, | ||
"collection_name": settings.MONGODB_OFFLINE_COLLECTION, | ||
"limit": 100, | ||
} | ||
|
||
ingest_to_mongodb(**ingest_json_config) | ||
|
||
fetch_from_mongodb(**fetch_documents_config) |
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,18 @@ | ||
from zenml import pipeline | ||
|
||
from second_brain.config import settings | ||
from steps.infrastructure import ( | ||
fetch_from_mongodb, | ||
) | ||
|
||
|
||
@pipeline | ||
def generate_dataset() -> None: | ||
fetch_documents_config = { | ||
"mongodb_uri": settings.MONGODB_OFFLINE_URI, | ||
"database_name": settings.MONGODB_OFFLINE_DATABASE, | ||
"collection_name": settings.MONGODB_OFFLINE_COLLECTION, | ||
"limit": 100, | ||
} | ||
|
||
fetch_from_mongodb(**fetch_documents_config) |
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
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
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
from .upload_to_s3 import upload_to_s3 | ||
from .fetch_from_mongodb import fetch_from_mongodb | ||
from .ingest_to_mongodb import ingest_to_mongodb | ||
from .upload_to_s3 import upload_to_s3 | ||
|
||
__all__ = ["upload_to_s3", "fetch_from_mongodb", "ingest_to_mongodb"] |
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
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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
from pathlib import Path | ||
|
||
from zenml import step | ||
|
||
from second_brain.config import settings | ||
|
Oops, something went wrong.