update the models of modelarts

This commit is contained in:
qiwang 2024-09-05 17:29:54 +08:00
parent 2d501c2e27
commit 07ff355339
5 changed files with 1299 additions and 1199 deletions

View File

@ -307,6 +307,7 @@ type (
ShareInfoAlRp = modelarts.ShareInfoAlRp ShareInfoAlRp = modelarts.ShareInfoAlRp
ShowAlgorithmByUuidReq = modelarts.ShowAlgorithmByUuidReq ShowAlgorithmByUuidReq = modelarts.ShowAlgorithmByUuidReq
ShowAlgorithmByUuidResp = modelarts.ShowAlgorithmByUuidResp ShowAlgorithmByUuidResp = modelarts.ShowAlgorithmByUuidResp
ShowModelDetail = modelarts.ShowModelDetail
ShowModelReq = modelarts.ShowModelReq ShowModelReq = modelarts.ShowModelReq
ShowModelResp = modelarts.ShowModelResp ShowModelResp = modelarts.ShowModelResp
ShowRepositoryReq = modelarts.ShowRepositoryReq ShowRepositoryReq = modelarts.ShowRepositoryReq

View File

@ -307,6 +307,7 @@ type (
ShareInfoAlRp = modelarts.ShareInfoAlRp ShareInfoAlRp = modelarts.ShareInfoAlRp
ShowAlgorithmByUuidReq = modelarts.ShowAlgorithmByUuidReq ShowAlgorithmByUuidReq = modelarts.ShowAlgorithmByUuidReq
ShowAlgorithmByUuidResp = modelarts.ShowAlgorithmByUuidResp ShowAlgorithmByUuidResp = modelarts.ShowAlgorithmByUuidResp
ShowModelDetail = modelarts.ShowModelDetail
ShowModelReq = modelarts.ShowModelReq ShowModelReq = modelarts.ShowModelReq
ShowModelResp = modelarts.ShowModelResp ShowModelResp = modelarts.ShowModelResp
ShowRepositoryReq = modelarts.ShowRepositoryReq ShowRepositoryReq = modelarts.ShowRepositoryReq

View File

@ -32,17 +32,23 @@ func (l *ShowModelsLogic) ShowModels(in *modelarts.ShowModelReq) (*modelarts.Sho
var resp modelarts.ShowModelResp var resp modelarts.ShowModelResp
platform, err := util.GetModelArtsConfWithPlatform(in.Platform) platform, err := util.GetModelArtsConfWithPlatform(l.svcCtx.Config.ModelArtsConf.Platform)
if err != nil { if err != nil {
return nil, err return nil, err
} }
body, err := util.SendRequest("GET", platform.Endpoint+"v1/"+platform.ProjectId+"/models/"+in.ModelId, body, err := util.SendRequest("GET", platform.Endpoint+"v1/"+platform.ProjectId+"/models/"+in.ModelId,
nil, in.Platform) nil, l.svcCtx.Config.ModelArtsConf.Platform)
if err != nil { if err != nil {
return nil, err return nil, err
} }
json.Unmarshal(*body, &resp) json.Unmarshal(*body, &resp.ShowModelDetail)
if resp.ShowModelDetail.ModelId != "" {
resp.Code = 200
resp.Msg = "Success"
} else {
resp.Code = 201
resp.Msg = "find Models is nil"
}
return &resp, nil return &resp, nil
} }

File diff suppressed because it is too large Load Diff

View File

@ -1492,6 +1492,11 @@ message ShowModelReq{
message ShowModelResp{ message ShowModelResp{
int32 code = 1; // @gotags: copier:"Code" int32 code = 1; // @gotags: copier:"Code"
ShowModelDetail ShowModelDetail =2;
string msg = 3; // @gotags: copier:"Msg"
}
message ShowModelDetail{
string model_version = 2; string model_version = 2;
string source_job_version = 3; string source_job_version = 3;
string source_location = 4; string source_location = 4;
@ -1517,18 +1522,19 @@ message ShowModelResp{
string model_id = 24; string model_id = 24;
repeated ModelDependencies dependencies = 25; repeated ModelDependencies dependencies = 25;
uint32 model_size = 26; uint32 model_size = 26;
string apis = 27; string model_status =27;
string model_source = 28; string apis = 28;
bool tunable = 29; string model_source = 29;
bool market_flag = 30; bool tunable = 30;
bool publishable_flag = 31; bool market_flag = 31;
repeated string model_labels = 32; bool publishable_flag = 32;
map<string, string> labels_map = 33; repeated string model_labels = 33;
repeated string install_type = 34; map<string, string> labels_map = 34;
string config = 35; repeated string install_type = 35;
ModelSpecification specification = 36; string config = 36;
repeated ModelParamsInfo input_params = 37; ModelSpecification specification = 37;
uint32 create_at = 38; repeated ModelParamsInfo input_params = 38;
uint32 create_at = 39;
} }
message ModelHealth{ message ModelHealth{