File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change 44
55import json
66import os
7+ import time
78from typing import Dict
89
910from oci .data_science .models import (
@@ -416,6 +417,28 @@ def create(
416417 value = source .display_name ,
417418 )
418419
420+ if create_fine_tuning_details .watch_logs :
421+ if (
422+ create_fine_tuning_details .log_id
423+ and create_fine_tuning_details .log_group_id
424+ ):
425+ logger .info (
426+ f"Watching fine-tuning job run logs for { ft_job_run .id } . Press Ctrl+C stop watching logs.\n "
427+ )
428+ try :
429+ ft_job_run .watch ()
430+ except KeyboardInterrupt :
431+ logger .info (f"\n Stopped watching logs for { ft_job_run .id } .\n " )
432+ time .sleep (2 )
433+ except Exception as ex :
434+ logger .debug (
435+ f"Something unexpected occurred while watching logs.\n { str (ex )} "
436+ )
437+ else :
438+ logger .info (
439+ "Logging details are not provided, set `log_id` and `log_group_id` to watch logs."
440+ )
441+
419442 return AquaFineTuningSummary (
420443 id = ft_model .id ,
421444 name = ft_model .display_name ,
You can’t perform that action at this time.
0 commit comments