Skip to content

Commit

Permalink
🐛 Fix (non-)use of path parameter in Models
Browse files Browse the repository at this point in the history
Additionally pretty-prints model file for easier editing
  • Loading branch information
Wiebke committed Mar 5, 2024
1 parent 132a5ea commit b51c998
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 8 deletions.
6 changes: 0 additions & 6 deletions assets/mode_description.json

This file was deleted.

69 changes: 69 additions & 0 deletions assets/models.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
{
"contents": [
{
"model_name": "random_forest",
"version": "1.0.0",
"type": "supervised",
"user": "mlexchange team",
"uri": "xxx",
"application": [
"classification",
"segmentation"
],
"description": "xxx",
"gui_parameters": [
{
"type": "int",
"name": "num-tree",
"title": "Number of Trees",
"param_key": "n_estimators",
"value": "30"
},
{
"type": "int",
"name": "tree-depth",
"title": "Tree Depth",
"param_key": "max_depth",
"value": "8"
}
],
"cmd": [
"xxx"
],
"reference": "Adapted from Dash Plotly image segmentation example"
},
{
"model_name": "kmeans",
"version": "1.0.0",
"type": "unsupervised",
"user": "mlexchange team",
"uri": "xxx",
"application": [
"segmentation",
"clustering"
],
"description": "xxx",
"gui_parameters": [
{
"type": "int",
"name": "num-cluster",
"title": "Number of Clusters",
"param_key": "n_clusters",
"value": "2"
},
{
"type": "int",
"name": "num-iter",
"title": "Max Iteration",
"param_key": "max_iter",
"value": "300"
}
],
"cmd": [
"xxx",
"xxxx"
],
"reference": "Nicholas Schwartz & Howard Yanxon"
}
]
}
4 changes: 2 additions & 2 deletions utils/content_registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@


class Models:
def __init__(self, modelfile_path="./assets/mode_description.json"):
def __init__(self, modelfile_path="./assets/models.json"):
self.path = modelfile_path
f = open("./assets/mode_description.json")
f = open(self.path)

self.contents = json.load(f)["contents"]
self.modelname_list = [content["model_name"] for content in self.contents]
Expand Down

0 comments on commit b51c998

Please sign in to comment.