chore: added logger and closes #33

This commit is contained in:
2023-10-06 09:45:47 +01:00
parent 84b9c40a72
commit 73511ec401
7 changed files with 150 additions and 5 deletions

View File

@@ -103,11 +103,21 @@ func handleRun(handle *Handle) {
img_file, err := os.Create(path.Join(run_path, "img.png"))
if err != nil {
return Error500(nil)
return Error500(err)
}
defer img_file.Close()
img_file.Write(file)
if !testImgForModel(c, model, path.Join(run_path, "img.png")) {
LoadDefineTemplate(w, "/models/edit.html", "run-model-card", c.AddMap(AnyMap{
"Model": model,
"NotFound": false,
"Result": nil,
"ImageError": true,
}))
return nil
}
root := tg.NewRoot()
tf_img := ReadPNG(root, path.Join(run_path, "img.png"), int64(model.ImageMode))