Browse Source

param opt

tags/v1.22.3.2^2
lewis 3 years ago
parent
commit
9a17b18b0c
2 changed files with 4 additions and 2 deletions
  1. +1
    -0
      modules/cloudbrain/cloudbrain.go
  2. +3
    -2
      routers/repo/cloudbrain.go

+ 1
- 0
modules/cloudbrain/cloudbrain.go View File

@@ -21,6 +21,7 @@ const (
CodeMountPath = "/code"
DataSetMountPath = "/dataset"
ModelMountPath = "/model"
LogFile = "log.txt"
BenchMarkMountPath = "/benchmark"
BenchMarkResourceID = 1
Snn4imagenetMountPath = "/snn4imagenet"


+ 3
- 2
routers/repo/cloudbrain.go View File

@@ -1439,6 +1439,7 @@ func getTrainJobCommand(form auth.CreateCloudBrainForm) (string, error) {
}

var parameters models.Parameters
var param string
if len(params) != 0 {
err := json.Unmarshal([]byte(params), &parameters)
if err != nil {
@@ -1447,11 +1448,11 @@ func getTrainJobCommand(form auth.CreateCloudBrainForm) (string, error) {
}

for _, parameter := range parameters.Parameter {
command += "export " + parameter.Label + "=" + parameter.Value + ";"
param += " --" + parameter.Label + "=" + parameter.Value
}
}

command += "python /code/" + bootFile
command += "python /code/" + bootFile + param + " > " + cloudbrain.ModelMountPath + "/" + cloudbrain.LogFile

return command, nil
}


Loading…
Cancel
Save