Skip to content

Commit 97a6121

Browse files
committed
add paths in tasks.py
1 parent 75d5bdd commit 97a6121

File tree

2 files changed

+14
-12
lines changed

2 files changed

+14
-12
lines changed

README.md

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -67,19 +67,7 @@ In this example we use `gpt_detector` pipeline and set some hyperparameters. In
6767
In addtion, the `SigLLM` object takes in a `decimal` argument to determine how many digits from the float value include. Here, we don't want to keep any decimal values, so we set it to zero.
6868

6969
```python3
70-
import os
7170
from sigllm import SigLLM
72-
from mlblocks.discovery import get_pipelines_paths, add_pipelines_path
73-
from mlblocks.discovery import get_primitives_paths, add_primitives_path
74-
75-
print(get_pipelines_paths())
76-
path = os.path.join(os.getcwd(), '..', '..', 'sigllm', 'pipelines', 'detector')
77-
add_pipelines_path(path)
78-
print(get_pipelines_paths())
79-
80-
path = os.path.join(os.getcwd(), '..', '..', 'sigllm', 'primitives', 'jsons')
81-
add_primitives_path(path)
82-
8371

8472
hyperparameters = {
8573
"orion.primitives.timeseries_anomalies.find_anomalies#1": {

tasks.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
from packaging.requirements import Requirement
1111
from packaging.version import Version
1212

13+
from mlblocks.discovery import add_primitives_path, add_pipelines_path
1314

1415
def _get_minimum_versions(dependencies, python_version):
1516
min_versions = {}
@@ -69,8 +70,21 @@ def minimum(c):
6970
unit(c)
7071

7172

73+
def add_paths():
74+
base_path = os.path.join(os.getcwd(), 'sigllm')
75+
primitives_path = os.path.join(base_path, 'primitives', 'jsons')
76+
pipeline_paths = [
77+
os.path.join(base_path, 'pipelines', 'detector'),
78+
os.path.join(base_path, 'pipelines', 'prompter')
79+
]
80+
add_primitives_path(primitives_path)
81+
for pipeline_path in pipeline_paths:
82+
add_pipelines_path(pipeline_path)
83+
84+
7285
@task
7386
def readme(c):
87+
add_paths()
7488
test_path = Path('tests/readme_test')
7589
if test_path.exists() and test_path.is_dir():
7690
shutil.rmtree(test_path)

0 commit comments

Comments
 (0)