Started working on moving to torch
This commit is contained in:
@@ -435,7 +435,7 @@ func handleDataUpload(handle *Handle) {
|
||||
}
|
||||
|
||||
model, err := GetBaseModel(handle.Db, id)
|
||||
if err == ModelNotFoundError {
|
||||
if err == NotFoundError {
|
||||
return c.SendJSONStatus(http.StatusNotFound, "Model not found")
|
||||
} else if err != nil {
|
||||
return c.Error500(err)
|
||||
@@ -468,7 +468,7 @@ func handleDataUpload(handle *Handle) {
|
||||
}
|
||||
PostAuthJson(handle, "/models/data/class/new", User_Normal, func(c *Context, obj *CreateNewEmptyClass) *Error {
|
||||
model, err := GetBaseModel(c.Db, obj.Id)
|
||||
if err == ModelNotFoundError {
|
||||
if err == NotFoundError {
|
||||
return c.JsonBadRequest("Model not found")
|
||||
} else if err != nil {
|
||||
return c.E500M("Failed to get model information", err)
|
||||
@@ -495,7 +495,7 @@ func handleDataUpload(handle *Handle) {
|
||||
return c.E500M("Could not create class", err)
|
||||
}
|
||||
|
||||
var modelClass model_classes.ModelClass
|
||||
var modelClass model_classes.ModelClassJSON
|
||||
err = GetDBOnce(c, &modelClass, "model_classes where id=$1;", id)
|
||||
if err != nil {
|
||||
return c.E500M("Failed to get class information but class was creted", err)
|
||||
@@ -518,7 +518,7 @@ func handleDataUpload(handle *Handle) {
|
||||
c.Logger.Info("model", "model", *model_id)
|
||||
|
||||
model, err := GetBaseModel(c.Db, *model_id)
|
||||
if err == ModelNotFoundError {
|
||||
if err == NotFoundError {
|
||||
return c.JsonBadRequest("Could not find the model")
|
||||
} else if err != nil {
|
||||
return c.E500M("Error getting model information", err)
|
||||
@@ -626,7 +626,7 @@ func handleDataUpload(handle *Handle) {
|
||||
c.Logger.Info("Trying to expand model", "id", id)
|
||||
|
||||
model, err := GetBaseModel(handle.Db, id)
|
||||
if err == ModelNotFoundError {
|
||||
if err == NotFoundError {
|
||||
return c.SendJSONStatus(http.StatusNotFound, "Model not found")
|
||||
} else if err != nil {
|
||||
return c.Error500(err)
|
||||
@@ -670,7 +670,7 @@ func handleDataUpload(handle *Handle) {
|
||||
}
|
||||
|
||||
model, err := GetBaseModel(handle.Db, dat.Id)
|
||||
if err == ModelNotFoundError {
|
||||
if err == NotFoundError {
|
||||
return c.SendJSONStatus(http.StatusNotFound, "Model not found")
|
||||
} else if err != nil {
|
||||
return c.Error500(err)
|
||||
@@ -704,7 +704,7 @@ func handleDataUpload(handle *Handle) {
|
||||
return c.Error500(err)
|
||||
}
|
||||
} else {
|
||||
_, err = handle.Db.Exec("delete from model_classes where model_id=$1 and status=$2;", model.Id, MODEL_CLASS_STATUS_TO_TRAIN)
|
||||
_, err = handle.Db.Exec("delete from model_classes where model_id=$1 and status=$2;", model.Id, CLASS_STATUS_TO_TRAIN)
|
||||
if err != nil {
|
||||
return c.Error500(err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user