chore: some more clean up

This commit is contained in:
2024-04-14 14:51:16 +01:00
parent fbf7eb9271
commit 8b13afba48
18 changed files with 483 additions and 479 deletions

View File

@@ -5,9 +5,9 @@ import (
"os"
"path"
. "git.andr3h3nriqu3s.com/andr3/fyp/logic/db_types"
. "git.andr3h3nriqu3s.com/andr3/fyp/logic/models/utils"
. "git.andr3h3nriqu3s.com/andr3/fyp/logic/tasks/utils"
. "git.andr3h3nriqu3s.com/andr3/fyp/logic/utils"
tf "github.com/galeone/tensorflow/tensorflow/go"
"github.com/galeone/tensorflow/tensorflow/go/op"
@@ -119,7 +119,7 @@ func runModelExp(base BasePack, model *BaseModel, def_id string, inputImage *tf.
}
func ClassifyTask(base BasePack, task Task) (err error) {
task.UpdateStatusLog(base, TASK_RUNNING, "Runner running task")
task.UpdateStatusLog(base, TASK_RUNNING, "Runner running task")
model, err := GetBaseModel(base.GetDb(), task.ModelId)
if err != nil {
@@ -206,13 +206,13 @@ func ClassifyTask(base BasePack, task Task) (err error) {
Confidence: confidence,
}
err = task.SetResult(base, returnValue)
if err != nil {
err = task.SetResult(base, returnValue)
if err != nil {
task.UpdateStatusLog(base, TASK_FAILED_RUNNING, "Failed to save model results")
return
}
}
task.UpdateStatusLog(base, TASK_DONE, "Model ran successfully")
return
return
}