Skip to content

Commit 56870dc

Browse files
committed
deleting trash
1 parent f88efbc commit 56870dc

File tree

5 files changed

+25
-86
lines changed

5 files changed

+25
-86
lines changed

src/scripts/Pipelines/model.joblib

-16.4 MB
Binary file not shown.

src/scripts/Pipelines/model_evalute.py

Lines changed: 0 additions & 35 deletions
This file was deleted.

src/scripts/Pipelines/model_redeploy_pipeline.py

Lines changed: 25 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,49 @@
11
import sys
22
import os
3+
import time
34
import yaml
45
from ibm_watson_machine_learning import APIClient
56

6-
# MODEL_PATH = os.path.abspath(sys.argv[1])
7-
CRED_PATH = os.path.abspath(sys.argv[1])
8-
# PROJ_PATH = os.path.abspath(sys.argv[3])
9-
# META_PATH = PROJ_PATH+"/metadata.yaml"
7+
"""
8+
Usage:
9+
python3 model_reploy_pipeline.py ./pickle_model ../path/to/project/ ../credentials.yaml
10+
11+
"""
12+
13+
MODEL_PATH = os.path.abspath(sys.argv[1])
14+
PROJ_PATH = os.path.abspath(sys.argv[2])
15+
CRED_PATH = os.path.abspath(sys.argv[3])
16+
META_PATH = PROJ_PATH + "/metadata.yaml"
1017

1118
with open(CRED_PATH) as stream:
1219
try:
1320
credentials = yaml.safe_load(stream)
1421
except yaml.YAMLError as exc:
1522
print(exc)
1623

24+
with open(META_PATH) as stream:
25+
try:
26+
metadata = yaml.safe_load(stream)
27+
except yaml.YAMLError as exc:
28+
print(exc)
1729

1830
wml_credentials = {"url": credentials["url"], "apikey": credentials["apikey"]}
1931

2032
client = APIClient(wml_credentials)
2133
client.spaces.list()
2234

2335
SPACE_ID = credentials["space_id"]
24-
MODEL_GUID = input("MODEL GUID: ")
25-
DEPLOYMENT_UID = input("DEPLOYMENT UID: ")
36+
37+
if "deployment_uid" in metadata.keys():
38+
MODEL_GUID = metadata["model_uid"]
39+
DEPLOYMENT_UID = metadata["deployment_uid"]
40+
print("\nExtracting DEPLOYMENT UID and MODEL GUID from metadata file\n")
41+
42+
else:
43+
MODEL_GUID = input("MODEL GUID: ")
44+
DEPLOYMENT_UID = input("DEPLOYMENT UID: ")
2645

2746
client.set.default_space(SPACE_ID)
28-
MODEL_GUID = "b065a8c6-01ec-461b-96cc-c3abdcc35405"
29-
DEPLOYMENT_UID = "560eed08-7d74-4ed8-8429-8d26b88cd8a3"
3047

3148
client.repository.list_models_revisions(MODEL_GUID)
3249

@@ -42,8 +59,6 @@
4259
deployment_uid=DEPLOYMENT_UID, changes=metadata
4360
)
4461

45-
import time
46-
4762
status = None
4863
while status not in ["ready", "failed"]:
4964
print(".", end=" ")

src/scripts/Pipelines/model_train.py

Lines changed: 0 additions & 41 deletions
This file was deleted.

src/scripts/Pipelines/pickle_model

-16.4 MB
Binary file not shown.

0 commit comments

Comments
 (0)