Skip to content

Commit 7f01dc5

Browse files
committed
json dumps
1 parent b10d124 commit 7f01dc5

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

labelbox/schema/model.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from typing import TYPE_CHECKING
2+
import json
23
from labelbox.orm import query
34
from labelbox.orm.db_object import DbObject
45
from labelbox.orm.model import Entity, Field, Relationship
@@ -37,7 +38,7 @@ def create_model_run(self, name, config=None) -> "ModelRun":
3738
model_id_param, query.results_query_part(ModelRun))
3839
res = self.client.execute(query_str, {
3940
name_param: name,
40-
config_param: config,
41+
config_param: json.dumps(config),
4142
model_id_param: self.uid
4243
})
4344
return ModelRun(self.client, res["createModelRun"])

tests/integration/annotation_import/test_model_run.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,11 @@ def test_model_run(client, configured_project_with_label, rand_gen):
1414
model = client.create_model(data["name"], data["ontology_id"])
1515

1616
name = rand_gen(str)
17-
config = {"batch_size": 100}
17+
config = {"batch_size": 100, "reruns": None }
1818
model_run = model.create_model_run(name, config)
1919
assert model_run.name == name
2020
assert model_run.training_metadata["batchSize"] == config["batch_size"]
21+
assert model_run.training_metadata["reruns"] == config["reruns"]
2122
assert model_run.model_id == model.uid
2223
assert model_run.created_by_id == client.get_user().uid
2324

0 commit comments

Comments
 (0)