forked from JointCloud/pcm-modelarts
update the models of modelarts
This commit is contained in:
parent
2d501c2e27
commit
07ff355339
|
@ -307,6 +307,7 @@ type (
|
|||
ShareInfoAlRp = modelarts.ShareInfoAlRp
|
||||
ShowAlgorithmByUuidReq = modelarts.ShowAlgorithmByUuidReq
|
||||
ShowAlgorithmByUuidResp = modelarts.ShowAlgorithmByUuidResp
|
||||
ShowModelDetail = modelarts.ShowModelDetail
|
||||
ShowModelReq = modelarts.ShowModelReq
|
||||
ShowModelResp = modelarts.ShowModelResp
|
||||
ShowRepositoryReq = modelarts.ShowRepositoryReq
|
||||
|
|
|
@ -307,6 +307,7 @@ type (
|
|||
ShareInfoAlRp = modelarts.ShareInfoAlRp
|
||||
ShowAlgorithmByUuidReq = modelarts.ShowAlgorithmByUuidReq
|
||||
ShowAlgorithmByUuidResp = modelarts.ShowAlgorithmByUuidResp
|
||||
ShowModelDetail = modelarts.ShowModelDetail
|
||||
ShowModelReq = modelarts.ShowModelReq
|
||||
ShowModelResp = modelarts.ShowModelResp
|
||||
ShowRepositoryReq = modelarts.ShowRepositoryReq
|
||||
|
|
|
@ -32,17 +32,23 @@ func (l *ShowModelsLogic) ShowModels(in *modelarts.ShowModelReq) (*modelarts.Sho
|
|||
|
||||
var resp modelarts.ShowModelResp
|
||||
|
||||
platform, err := util.GetModelArtsConfWithPlatform(in.Platform)
|
||||
platform, err := util.GetModelArtsConfWithPlatform(l.svcCtx.Config.ModelArtsConf.Platform)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
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 {
|
||||
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
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1492,6 +1492,11 @@ message ShowModelReq{
|
|||
|
||||
message ShowModelResp{
|
||||
int32 code = 1; // @gotags: copier:"Code"
|
||||
ShowModelDetail ShowModelDetail =2;
|
||||
string msg = 3; // @gotags: copier:"Msg"
|
||||
}
|
||||
|
||||
message ShowModelDetail{
|
||||
string model_version = 2;
|
||||
string source_job_version = 3;
|
||||
string source_location = 4;
|
||||
|
@ -1517,18 +1522,19 @@ message ShowModelResp{
|
|||
string model_id = 24;
|
||||
repeated ModelDependencies dependencies = 25;
|
||||
uint32 model_size = 26;
|
||||
string apis = 27;
|
||||
string model_source = 28;
|
||||
bool tunable = 29;
|
||||
bool market_flag = 30;
|
||||
bool publishable_flag = 31;
|
||||
repeated string model_labels = 32;
|
||||
map<string, string> labels_map = 33;
|
||||
repeated string install_type = 34;
|
||||
string config = 35;
|
||||
ModelSpecification specification = 36;
|
||||
repeated ModelParamsInfo input_params = 37;
|
||||
uint32 create_at = 38;
|
||||
string model_status =27;
|
||||
string apis = 28;
|
||||
string model_source = 29;
|
||||
bool tunable = 30;
|
||||
bool market_flag = 31;
|
||||
bool publishable_flag = 32;
|
||||
repeated string model_labels = 33;
|
||||
map<string, string> labels_map = 34;
|
||||
repeated string install_type = 35;
|
||||
string config = 36;
|
||||
ModelSpecification specification = 37;
|
||||
repeated ModelParamsInfo input_params = 38;
|
||||
uint32 create_at = 39;
|
||||
}
|
||||
|
||||
message ModelHealth{
|
||||
|
|
Loading…
Reference in New Issue