Skip to content

Commit

Permalink
feat(workshop): clean up for workshop
Browse files Browse the repository at this point in the history
  • Loading branch information
guillaume-chervet committed Dec 15, 2023
1 parent 94372e9 commit c8c9163
Showing 1 changed file with 22 additions and 10 deletions.
32 changes: 22 additions & 10 deletions train/azureml_run_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def azureml_pipeline(

return {
"extraction_output": extraction.outputs.images_output,
"extraction_hash_output": extraction.outputs.hash_output,
#"extraction_hash_output": extraction.outputs.hash_output,
"model_output": test_data.outputs.model_output,
"integration_output": test_data.outputs.integration_output,
}
Expand All @@ -111,12 +111,12 @@ def azureml_pipeline(
pipeline_job.outputs.model_output = Output(
type=AssetTypes.URI_FOLDER, mode="rw_mount", path=custom_extraction_path
)
custom_extraction_hash_path = (
azure_blob + "extraction_hash/cats-dogs-others/" + experiment_id + "/"
)
pipeline_job.outputs.extraction_hash_output = Output(
type=AssetTypes.URI_FOLDER, mode="rw_mount", path=custom_extraction_hash_path
)
#custom_extraction_hash_path = (
# azure_blob + "extraction_hash/cats-dogs-others/" + experiment_id + "/"
#)
#pipeline_job.outputs.extraction_hash_output = Output(
# type=AssetTypes.URI_FOLDER, mode="rw_mount", path=custom_extraction_hash_path
#)

custom_model_path = azure_blob + "models/cats-dogs-others/" + experiment_id + "/"
pipeline_job.outputs.model_output = Output(
Expand All @@ -133,13 +133,25 @@ def azureml_pipeline(
pipeline_job, experiment_name="cats_dos_others_pipeline"
)

import threading
import time

def get_token():
while True:
token = credential.get_token("https://management.azure.com/.default")
print("Token obtenu:", token.token)
time.sleep(60) # Attendre 60 secondes

token_thread = threading.Thread(target=get_token)
token_thread.start()

ml_client.jobs.stream(pipeline_job.name)

credential.get_token("https://management.azure.com/.default")

register_extracted_dataset(
ml_client, custom_extraction_hash_path, custom_extraction_path, {}
)
#register_extracted_dataset(
# ml_client, custom_extraction_hash_path, custom_extraction_path, {}
#)

model_name = "cats-dogs-others"
try:
Expand Down

0 comments on commit c8c9163

Please sign in to comment.