|
|
@@ -260,6 +260,16 @@ func (m *ModelArtsLink) UploadAlgorithmCode(ctx context.Context, resourceType st |
|
|
return nil |
|
|
return nil |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
func (m *ModelArtsLink) GetModelId(ctx context.Context, option *option.AiOption, ifoption *option.InferOption) error { |
|
|
|
|
|
req := &modelarts.ListModelReq{} |
|
|
|
|
|
specResp, err := m.modelArtsRpc.ListModels(ctx, req) |
|
|
|
|
|
if err != nil { |
|
|
|
|
|
return err |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return nil |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
func (m *ModelArtsLink) GetTrainingTaskLog(ctx context.Context, taskId string, instanceNum string) (string, error) { |
|
|
func (m *ModelArtsLink) GetTrainingTaskLog(ctx context.Context, taskId string, instanceNum string) (string, error) { |
|
|
req := &modelartsservice.GetTrainingJobLogsPreviewReq{ |
|
|
req := &modelartsservice.GetTrainingJobLogsPreviewReq{ |
|
|
Platform: m.platform, |
|
|
Platform: m.platform, |
|
|
@@ -364,7 +374,7 @@ func (m *ModelArtsLink) GenerateSubmitParams(ctx context.Context, option *option |
|
|
return nil |
|
|
return nil |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
func (m *ModelArtsLink) generateResourceId(ctx context.Context, option *option.AiOption) error { |
|
|
|
|
|
|
|
|
func (m *ModelArtsLink) generateResourceId(ctx context.Context, option *option.AiOption, ifoption *option.InferOption) error { |
|
|
option.ResourceId = "modelarts.kat1.xlarge" |
|
|
option.ResourceId = "modelarts.kat1.xlarge" |
|
|
return nil |
|
|
return nil |
|
|
} |
|
|
} |
|
|
@@ -541,7 +551,27 @@ func (m *ModelArtsLink) GetInferResult(ctx context.Context, url string, file mul |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
func (m *ModelArtsLink) CreateInferDeployInstance(ctx context.Context, option *option.InferOption) (string, error) { |
|
|
func (m *ModelArtsLink) CreateInferDeployInstance(ctx context.Context, option *option.InferOption) (string, error) { |
|
|
return "", nil |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
configParam := &modelarts.ServiceConfig{ |
|
|
|
|
|
Specification: option.Specification, |
|
|
|
|
|
Weight: option.Weight, |
|
|
|
|
|
ModelId: option.ModelId, |
|
|
|
|
|
InstanceCount: option.InstanceCount, |
|
|
|
|
|
} |
|
|
|
|
|
var configItems []*modelarts.ServiceConfig |
|
|
|
|
|
configItems = append(configItems, configParam) |
|
|
|
|
|
req := &modelarts.CreateServiceReq{ |
|
|
|
|
|
Platform: m.platform, |
|
|
|
|
|
Config: configItems, |
|
|
|
|
|
InferType: option.InferType, |
|
|
|
|
|
ServiceName: option.TaskName, |
|
|
|
|
|
} |
|
|
|
|
|
resp, err := m.modelArtsRpc.CreateService(ctx, req) |
|
|
|
|
|
if err != nil { |
|
|
|
|
|
return "", err |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return resp.ServiceId, nil |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
func (m *ModelArtsLink) CheckModelExistence(ctx context.Context, name string, mtype string) bool { |
|
|
func (m *ModelArtsLink) CheckModelExistence(ctx context.Context, name string, mtype string) bool { |
|
|
|