Started working on moving to torch

This commit is contained in:
2024-04-19 15:39:51 +01:00
parent 2fa7680d0b
commit 28707b3f1b
28 changed files with 1082 additions and 430 deletions

View File

@@ -14,7 +14,7 @@ func handleRequests(x *Handle) {
PostAuthJson(x, "/task/agreement", User_Normal, func(c *Context, dat *AgreementRequest) *Error {
var task Task
err := GetDBOnce(c, &task, "tasks where id=$1", dat.Id)
if err == ModelNotFoundError {
if err == NotFoundError {
return c.JsonBadRequest("Model not found")
} else if err != nil {
return c.E500M("Failed to get task data", err)

View File

@@ -46,7 +46,7 @@ func handleList(handler *Handle) {
if requestData.ModelId != "" {
_, err := GetBaseModel(c.Db, requestData.ModelId)
if err == ModelNotFoundError {
if err == NotFoundError {
return c.SendJSONStatus(404, "Model not found!")
} else if err != nil {
return c.Error500(err)

View File

@@ -11,7 +11,8 @@ import (
"git.andr3h3nriqu3s.com/andr3/fyp/logic/db"
. "git.andr3h3nriqu3s.com/andr3/fyp/logic/db_types"
. "git.andr3h3nriqu3s.com/andr3/fyp/logic/models"
// . "git.andr3h3nriqu3s.com/andr3/fyp/logic/models"
. "git.andr3h3nriqu3s.com/andr3/fyp/logic/models/train"
. "git.andr3h3nriqu3s.com/andr3/fyp/logic/tasks/utils"
. "git.andr3h3nriqu3s.com/andr3/fyp/logic/users"
@@ -52,9 +53,10 @@ func runner(config Config, db db.Db, task_channel chan Task, index int, back_cha
if task.TaskType == int(TASK_TYPE_CLASSIFICATION) {
logger.Info("Classification Task")
if err = ClassifyTask(base, task); err != nil {
/*if err = ClassifyTask(base, task); err != nil {
logger.Error("Classification task failed", "error", err)
}
}*/
task.UpdateStatusLog(base, TASK_FAILED_RUNNING, "TODO move tasks to pytorch")
back_channel <- index
continue