Skip to content

Commit 29c4a92

Browse files
committed
feat: formatted the code
1 parent 6dff8b4 commit 29c4a92

File tree

9 files changed

+25
-18
lines changed

9 files changed

+25
-18
lines changed

aml_service/00-WorkSpace.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
name=workspace_name,
4646
subscription_id=subscription_id,
4747
resource_group=resource_group,
48-
auth=cli_auth
48+
auth=cli_auth,
4949
)
5050

5151
except:
@@ -57,8 +57,7 @@
5757
resource_group=resource_group,
5858
# create_resource_group=True,
5959
location=location,
60-
auth=cli_auth
61-
60+
auth=cli_auth,
6261
)
6362

6463
# print Workspace details

aml_service/01-Experiment.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,10 @@
2727
from azureml.core import Experiment
2828
from azureml.core import Workspace
2929
from azureml.core.authentication import AzureCliAuthentication
30+
3031
cli_auth = AzureCliAuthentication()
3132

33+
3234
def getExperiment():
3335
ws = Workspace.from_config(auth=cli_auth)
3436
script_folder = "."

aml_service/02-AttachTrainingVM.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
from azureml.core.compute import DsvmCompute
3535
from azureml.core.compute_target import ComputeTargetException
3636
from azureml.core.authentication import AzureCliAuthentication
37+
3738
cli_auth = AzureCliAuthentication()
3839

3940
# Get workspace

aml_service/03-AttachAmlCluster.py

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -38,28 +38,29 @@
3838
with open("aml_config/security_config.json") as f:
3939
config = json.load(f)
4040

41-
aml_cluster_name = config['aml_cluster_name']
41+
aml_cluster_name = config["aml_cluster_name"]
4242

43-
# un-comment the below lines if you want to put AML Compute under Vnet. Also update /aml_config/security_config.json
43+
# un-comment the below lines if you want to put AML Compute under Vnet. Also update /aml_config/security_config.json
4444
# vnet_resourcegroup_name = config['vnet_resourcegroup_name']
4545
# vnet_name = config['vnet_name']
4646
# subnet_name = config['subnet_name']
4747

4848
# Verify that cluster does not exist already
4949
try:
5050
cpu_cluster = ComputeTarget(workspace=ws, name=aml_cluster_name)
51-
print('Found existing cluster, use it.')
51+
print("Found existing cluster, use it.")
5252
except ComputeTargetException:
53-
compute_config = AmlCompute.provisioning_configuration(vm_size='STANDARD_D2_V2',
54-
vm_priority='dedicated',
55-
min_nodes=1,
56-
max_nodes=3,
57-
idle_seconds_before_scaledown='300',
58-
# #Uncomment the below lines for VNet support
59-
# vnet_resourcegroup_name=vnet_resourcegroup_name,
60-
# vnet_name=vnet_name,
61-
# subnet_name=subnet_name
62-
)
53+
compute_config = AmlCompute.provisioning_configuration(
54+
vm_size="STANDARD_D2_V2",
55+
vm_priority="dedicated",
56+
min_nodes=1,
57+
max_nodes=3,
58+
idle_seconds_before_scaledown="300",
59+
# #Uncomment the below lines for VNet support
60+
# vnet_resourcegroup_name=vnet_resourcegroup_name,
61+
# vnet_name=vnet_name,
62+
# subnet_name=subnet_name
63+
)
6364
cpu_cluster = ComputeTarget.create(ws, aml_cluster_name, compute_config)
6465

65-
cpu_cluster.wait_for_completion(show_output=True)
66+
cpu_cluster.wait_for_completion(show_output=True)

aml_service/10-TrainOnLocal.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
from azureml.core import ScriptRunConfig
3131
import json
3232
from azureml.core.authentication import AzureCliAuthentication
33+
3334
cli_auth = AzureCliAuthentication()
3435

3536
# Get workspace

aml_service/11-TrainOnLocalEnv.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
from azureml.core import ScriptRunConfig
3434

3535
from azureml.core.authentication import AzureCliAuthentication
36+
3637
cli_auth = AzureCliAuthentication()
3738

3839
# Get workspace

aml_service/15-EvaluateModel.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
import azureml.core
3131
from azureml.core import Run
3232
from azureml.core.authentication import AzureCliAuthentication
33+
3334
cli_auth = AzureCliAuthentication()
3435

3536
# Get workspace

aml_service/20-RegisterModel.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131

3232
from azureml.core.runconfig import RunConfiguration
3333
from azureml.core.authentication import AzureCliAuthentication
34+
3435
cli_auth = AzureCliAuthentication()
3536

3637
# Get workspace

aml_service/50-deployOnAci.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434

3535
cli_auth = AzureCliAuthentication()
3636
# Get workspace
37-
ws = Workspace.from_config(auth=cli_auth)# Get the Image to deploy details
37+
ws = Workspace.from_config(auth=cli_auth) # Get the Image to deploy details
3838
try:
3939
with open("aml_config/image.json") as f:
4040
config = json.load(f)

0 commit comments

Comments
 (0)