@@ -159,7 +159,8 @@ def create(
159
159
create_aqua_evaluation_details = CreateAquaEvaluationDetails (** kwargs )
160
160
except Exception as ex :
161
161
custom_errors = {
162
- "." .join (map (str , e ["loc" ])): e ["msg" ] for e in json .loads (ex .json ())
162
+ "." .join (map (str , e ["loc" ])): e ["msg" ]
163
+ for e in json .loads (ex .json ())
163
164
}
164
165
raise AquaValueError (
165
166
f"Invalid create evaluation parameters. Error details: { custom_errors } ."
@@ -296,6 +297,10 @@ def create(
296
297
evaluation_mvs_freeform_tags = {
297
298
Tags .AQUA_EVALUATION : Tags .AQUA_EVALUATION ,
298
299
}
300
+ evaluation_mvs_freeform_tags = {
301
+ ** evaluation_mvs_freeform_tags ,
302
+ ** (create_aqua_evaluation_details .freeform_tags or {}),
303
+ }
299
304
300
305
model_version_set = (
301
306
ModelVersionSet ()
@@ -306,6 +311,9 @@ def create(
306
311
create_aqua_evaluation_details .experiment_description
307
312
)
308
313
.with_freeform_tags (** evaluation_mvs_freeform_tags )
314
+ .with_defined_tags (
315
+ ** (create_aqua_evaluation_details .defined_tags or {})
316
+ )
309
317
# TODO: decide what parameters will be needed
310
318
.create (** kwargs )
311
319
)
@@ -368,6 +376,10 @@ def create(
368
376
Tags .AQUA_EVALUATION : Tags .AQUA_EVALUATION ,
369
377
Tags .AQUA_EVALUATION_MODEL_ID : evaluation_model .id ,
370
378
}
379
+ evaluation_job_freeform_tags = {
380
+ ** evaluation_job_freeform_tags ,
381
+ ** (create_aqua_evaluation_details .freeform_tags or {}),
382
+ }
371
383
372
384
evaluation_job = Job (name = evaluation_model .display_name ).with_infrastructure (
373
385
DataScienceJob ()
@@ -378,6 +390,7 @@ def create(
378
390
.with_shape_name (create_aqua_evaluation_details .shape_name )
379
391
.with_block_storage_size (create_aqua_evaluation_details .block_storage_size )
380
392
.with_freeform_tag (** evaluation_job_freeform_tags )
393
+ .with_defined_tag (** (create_aqua_evaluation_details .defined_tags or {}))
381
394
)
382
395
if (
383
396
create_aqua_evaluation_details .memory_in_gbs
@@ -424,6 +437,7 @@ def create(
424
437
evaluation_job_run = evaluation_job .run (
425
438
name = evaluation_model .display_name ,
426
439
freeform_tags = evaluation_job_freeform_tags ,
440
+ defined_tags = (create_aqua_evaluation_details .defined_tags or {}),
427
441
wait = False ,
428
442
)
429
443
logger .debug (
@@ -443,13 +457,20 @@ def create(
443
457
for metadata in evaluation_model_custom_metadata .to_dict ()["data" ]
444
458
]
445
459
460
+ evaluation_model_freeform_tags = {
461
+ Tags .AQUA_EVALUATION : Tags .AQUA_EVALUATION ,
462
+ ** (create_aqua_evaluation_details .freeform_tags or {}),
463
+ }
464
+ evaluation_model_defined_tags = (
465
+ create_aqua_evaluation_details .defined_tags or {}
466
+ )
467
+
446
468
self .ds_client .update_model (
447
469
model_id = evaluation_model .id ,
448
470
update_model_details = UpdateModelDetails (
449
471
custom_metadata_list = updated_custom_metadata_list ,
450
- freeform_tags = {
451
- Tags .AQUA_EVALUATION : Tags .AQUA_EVALUATION ,
452
- },
472
+ freeform_tags = evaluation_model_freeform_tags ,
473
+ defined_tags = evaluation_model_defined_tags ,
453
474
),
454
475
)
455
476
@@ -523,6 +544,8 @@ def create(
523
544
"evaluation_job_id" : evaluation_job .id ,
524
545
"evaluation_source" : create_aqua_evaluation_details .evaluation_source_id ,
525
546
"evaluation_experiment_id" : experiment_model_version_set_id ,
547
+ ** evaluation_model_freeform_tags ,
548
+ ** evaluation_model_defined_tags ,
526
549
},
527
550
parameters = AquaEvalParams (),
528
551
)
@@ -619,11 +642,6 @@ def _build_launch_cmd(
619
642
evaluation_id = evaluation_id ,
620
643
evaluation_target_id = evaluation_source_id ,
621
644
input_data = {
622
- "columns" : {
623
- "prompt" : "prompt" ,
624
- "completion" : "completion" ,
625
- "category" : "category" ,
626
- },
627
645
"format" : Path (dataset_path ).suffix ,
628
646
"url" : dataset_path ,
629
647
},
0 commit comments