File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 146146 },
147147 "toolUsage" : {
148148 "type" : " boolean"
149+ },
150+ "reward" : {
151+ "type" : " boolean"
152+ },
153+ "languages" : {
154+ "type" : " array" ,
155+ "items" : {
156+ "type" : " string" ,
157+ "pattern" : " ^[a-z]{2}$"
158+ }
149159 }
150- }
160+ },
161+ "additionalProperties" : false
151162 },
152163 "Modality" : {
153164 "type" : " string" ,
Original file line number Diff line number Diff line change @@ -474,6 +474,109 @@ func TestConfig(t *testing.T) {
474474 ]
475475 }
476476}
477+ ` ,
478+ fail : true ,
479+ },
480+ // expected failure: reward is not boolean
481+ {
482+ config : `
483+ {
484+ "descriptor": {
485+ "name": "xyz-3-8B-Instruct",
486+ "version": "3.1"
487+ },
488+ "config": {
489+ "paramSize": "8b",
490+ "capabilities": {
491+ "inputTypes": ["text"],
492+ "outputTypes": ["text"],
493+ "reward": "true"
494+ }
495+ },
496+ "modelfs": {
497+ "type": "layers",
498+ "diffIds": [
499+ "sha256:1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef"
500+ ]
501+ }
502+ }
503+ ` ,
504+ fail : true ,
505+ },
506+ // expected failure: languages is not an array
507+ {
508+ config : `
509+ {
510+ "descriptor": {
511+ "name": "xyz-3-8B-Instruct",
512+ "version": "3.1"
513+ },
514+ "config": {
515+ "paramSize": "8b",
516+ "capabilities": {
517+ "inputTypes": ["text"],
518+ "outputTypes": ["text"],
519+ "languages": "en"
520+ }
521+ },
522+ "modelfs": {
523+ "type": "layers",
524+ "diffIds": [
525+ "sha256:1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef"
526+ ]
527+ }
528+ }
529+ ` ,
530+ fail : true ,
531+ },
532+ // expected failure: language code is not a two-letter ISO 639 code
533+ {
534+ config : `
535+ {
536+ "descriptor": {
537+ "name": "xyz-3-8B-Instruct",
538+ "version": "3.1"
539+ },
540+ "config": {
541+ "paramSize": "8b",
542+ "capabilities": {
543+ "inputTypes": ["text"],
544+ "outputTypes": ["text"],
545+ "languages": ["fra"]
546+ }
547+ },
548+ "modelfs": {
549+ "type": "layers",
550+ "diffIds": [
551+ "sha256:1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef"
552+ ]
553+ }
554+ }
555+ ` ,
556+ fail : true ,
557+ },
558+ // expected failure: unknown field in capabilities
559+ {
560+ config : `
561+ {
562+ "descriptor": {
563+ "name": "xyz-3-8B-Instruct",
564+ "version": "3.1"
565+ },
566+ "config": {
567+ "paramSize": "8b",
568+ "capabilities": {
569+ "inputTypes": ["text"],
570+ "unknownField": true
571+ }
572+ },
573+ "modelfs": {
574+ "type": "layers",
575+ "diffIds": [
576+ "sha256:1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef"
577+ ]
578+ }
579+ }
477580` ,
478581 fail : true ,
479582 },
You can’t perform that action at this time.
0 commit comments