Merge pull request 'updated shuguang deployinstance logics' (#306) from tzwang/pcm-coordinator:master into master
Former-commit-id: 8407ba4972eb95b59845dbf471475042171fff64
This commit is contained in:
commit
9b142e6ba1
|
@ -84,10 +84,10 @@ var (
|
|||
CardModelNameCmdMap = map[string]map[string]string{
|
||||
BIV100: {"blip-image-captioning-base": "pip install -U transformers; pip install fastapi uvicorn[standard]; pip install python-multipart; cd /code; python infer_biv100.py",
|
||||
"imagenet_resnet50": "pip install -U transformers; pip install fastapi uvicorn[standard]; pip install python-multipart; cd /code/infer; python infer_biv100.py",
|
||||
"chatGLM_6B": "su root; pip install transformers==4.33.2; pip install fastapi uvicorn[standard]; cd /code; python infer_biv100.py"},
|
||||
"ChatGLM_6B": "su root; pip install transformers==4.33.2; pip install fastapi uvicorn[standard]; cd /code; python infer_biv100.py"},
|
||||
MLU: {"blip-image-captioning-base": "",
|
||||
"imagenet_resnet50": "su root; . /torch/venv3/pytorch/bin/activate; pip install fastapi uvicorn[standard]; pip install python-multipart; cd /code/infer; python infer_mlu.py",
|
||||
"chatGLM_6B": ""},
|
||||
"ChatGLM_6B": ""},
|
||||
}
|
||||
)
|
||||
|
||||
|
|
|
@ -24,6 +24,7 @@ import (
|
|||
"gitlink.org.cn/JointCloud/pcm-coordinator/internal/scheduler/service/collector"
|
||||
"gitlink.org.cn/JointCloud/pcm-coordinator/internal/scheduler/service/inference"
|
||||
"gitlink.org.cn/JointCloud/pcm-coordinator/internal/types"
|
||||
"gitlink.org.cn/JointCloud/pcm-coordinator/pkg/constants"
|
||||
"gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils"
|
||||
"mime/multipart"
|
||||
"strconv"
|
||||
|
@ -867,6 +868,25 @@ func (s *ShuguangAi) GetInferDeployInstance(ctx context.Context, id string) (*in
|
|||
if err != nil || resp.Code != "0" {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
var url string
|
||||
if resp.Data.Status == constants.Running {
|
||||
url = resp.Data.ContainerPortInfoList[0].ContentPath
|
||||
}
|
||||
|
||||
var modelType string
|
||||
var modelName string
|
||||
var card string
|
||||
|
||||
if resp.Data.Description != "" {
|
||||
str := strings.Split(resp.Data.Description, FORWARD_SLASH)
|
||||
if len(str) == 3 {
|
||||
modelType = str[0]
|
||||
modelName = str[1]
|
||||
card = str[2]
|
||||
}
|
||||
}
|
||||
|
||||
ins.InstanceName = resp.Data.InstanceServiceName
|
||||
ins.InstanceId = resp.Data.Id
|
||||
ins.ClusterName = s.platform
|
||||
|
@ -874,6 +894,10 @@ func (s *ShuguangAi) GetInferDeployInstance(ctx context.Context, id string) (*in
|
|||
ins.InferCard = DCU
|
||||
ins.CreatedTime = resp.Data.CreateTime
|
||||
ins.ClusterType = TYPE_SHUGUANGAI
|
||||
ins.ModelType = modelType
|
||||
ins.ModelName = modelName
|
||||
ins.InferUrl = url
|
||||
ins.InferCard = card
|
||||
|
||||
return ins, nil
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue