Commit 4fb25652 authored by vicotor's avatar vicotor

add test standardtask

parent cc1377a3
package standardlib
import (
"fmt"
"math/rand"
)
type SmallCar struct {
}
func init() {
RegisterStdLib("smallcar", &SmallCar{})
}
func (g *SmallCar) GenerateParam(difficult int) (string, error) {
m := rand.Intn(256)
param := fmt.Sprintf("{\n \"model_name\": \"Realistic_Vision_V1.4\",\n \"model_type\": \"tex2img\",\n \"desc\": {\n \"prompt\": \" a car with number %d\",\n \"steps\": 20\n }\n}", m)
return param, nil
}
func (g *SmallCar) VerifyResult(param string, result []byte) bool {
if len(result) > 0 {
return true
}
return false
}
......@@ -3,9 +3,16 @@
"task_kind": 3,
"task_type":999,
"task_cmd":"{\"image_name\":\"demianhjw/ethaddr:latest\",\"docker_cmd\":{\"container_port\":\"5001\"},\"api_url\":\"http://127.0.0.1:%d/aigic\"}",
"task_timestamp":1708574058633402301,
"task_fee":"0",
"task_workload":100,
"standlib": "ethaddr"
}
},
{
"task_kind": 3,
"task_type":998,
"task_cmd":"{\"image_name\":\"demianhjw/ethaddr:latest\",\"docker_cmd\":{\"container_port\":\"5001\"},\"api_url\":\"http://127.0.0.1:%d/aigic\"}",
"task_fee":"0",
"task_workload":100,
"standlib": "smallcar"
}
]
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment