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 4
4
5
5
import json
6
6
import os
7
+ import time
7
8
from typing import Dict
8
9
9
10
from oci .data_science .models import (
@@ -416,6 +417,28 @@ def create(
416
417
value = source .display_name ,
417
418
)
418
419
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
+
419
442
return AquaFineTuningSummary (
420
443
id = ft_model .id ,
421
444
name = ft_model .display_name ,
You can’t perform that action at this time.
0 commit comments