Created
December 16, 2020 12:06
-
-
Save Geremie/706946557278a3de8fc6e616b1d7588e to your computer and use it in GitHub Desktop.
Automate your ML model retraining with Kubeflow
This file contains hidden or 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
| def trigger(project_id, bucket_name, train_steps, model_folder, host): | |
| client = kfp.Client(namespace='default', host=host) | |
| params = { | |
| 'project_id': project_id, | |
| 'bucket_name': bucket_name, | |
| 'train_steps': train_steps, | |
| 'model_folder': model_folder | |
| } | |
| experiments = client.list_experiments() | |
| experiment_id = experiments.experiments[0].id | |
| pipeline_id = client.get_pipeline_id(PIPELINE_NAME) | |
| job_name = '{}-run-{}'.format(PIPELINE_NAME, str(round(datetime.utcnow().timestamp()))) | |
| try: | |
| my_run = client.run_pipeline(experiment_id=experiment_id, job_name=job_name, | |
| pipeline_id=pipeline_id, params=params) | |
| except Exception as error: | |
| print(error) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment