mirror of
https://github.com/clearml/clearml-server
synced 2025-06-26 23:15:47 +00:00
Initial commit
This commit is contained in:
11
server/database/model/model_labels.py
Normal file
11
server/database/model/model_labels.py
Normal file
@@ -0,0 +1,11 @@
|
||||
from mongoengine import MapField, IntField
|
||||
|
||||
|
||||
class ModelLabels(MapField):
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(ModelLabels, self).__init__(field=IntField(), *args, **kwargs)
|
||||
|
||||
def validate(self, value):
|
||||
super(ModelLabels, self).validate(value)
|
||||
if value and (len(set(value.values())) < len(value)):
|
||||
self.error("Same label id appears more than once in model labels")
|
||||
Reference in New Issue
Block a user