fix: update modelarts ServiceName now.Unix of ai

This commit is contained in:
qiwang 2024-09-19 08:45:37 +08:00
parent 32bc8b11fe
commit 0003d147a0
1 changed files with 4 additions and 1 deletions

View File

@ -791,11 +791,14 @@ func (m *ModelArtsLink) CreateInferDeployInstance(ctx context.Context, option *o
}
var configItems []*modelarts.ServiceConfig
configItems = append(configItems, configParam)
now := time.Now()
timestampSec := now.Unix()
str := strconv.FormatInt(timestampSec, 10)
req := &modelarts.CreateServiceReq{
Platform: m.platform,
Config: configItems,
InferType: "real-time",
ServiceName: option.ModelName + "_" + option.ModelType + "_" + Npu,
ServiceName: option.ModelName + "_" + option.ModelType + "_" + Npu + "_" + str,
}
ctx, cancel := context.WithTimeout(context.Background(), 150*time.Second)
defer cancel()