Skip to content

Commit

Permalink
Merge pull request #762 from bjwswang/release-v0.2.0
Browse files Browse the repository at this point in the history
add more info to models
  • Loading branch information
bjwswang committed Feb 28, 2024
2 parents 7beebdf + fc79c1a commit 3132ba8
Show file tree
Hide file tree
Showing 7 changed files with 81 additions and 3 deletions.
15 changes: 14 additions & 1 deletion api/base/v1alpha1/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@ const (
// LabelModelEmbedding indicates this is a embedding model
LabelModelEmbedding = Group + "/embedding"
// LabelModelLLM indicates this is a llm model
LabelModelLLM = Group + "/llm"
LabelModelLLM = Group + "/llm"
// LabelModelReranking indicates this is a reranking model
LabelModelReranking = Group + "/reranking"
// LabelModelFullPath indicates the full path in storage
LabelModelFullPath = Group + "/full-path"
)

Expand All @@ -52,6 +55,16 @@ func (model Model) IsEmbeddingModel() bool {
return false
}

// IsRerankingModel checks whether this model is a reranking model
func (model Model) IsRerankingModel() bool {
for _, t := range strings.Split(model.Spec.Types, ",") {
if strings.ToLower(t) == "reranking" {
return true
}
}
return false
}

// FullPath with bucket and object path
func (model Model) FullPath() string {
return fmt.Sprintf("%s/%s", model.Namespace, model.ObjectPath())
Expand Down
8 changes: 8 additions & 0 deletions api/base/v1alpha1/model_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,14 @@ type ModelSpec struct {

// Source define the source of the model file
Source *TypedObjectReference `json:"source,omitempty"`

// HuggingFaceRepo defines the huggingface repo which hosts this model
HuggingFaceRepo string `json:"huggingFaceRepo,omitempty"`
// ModelScopeRepo defines the modelscope repo which hosts this model
ModelScopeRepo string `json:"modelScopeRepo,omitempty"`

// MaxContextLength defines the max context length allowed in this model
MaxContextLength int `json:"maxContextLength,omitempty"`
}

// ModelStatus defines the observed state of Model
Expand Down
12 changes: 12 additions & 0 deletions config/crd/bases/arcadia.kubeagi.k8s.com.cn_models.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,18 @@ spec:
displayName:
description: DisplayName defines datasource display name
type: string
huggingFaceRepo:
description: HuggingFaceRepo defines the huggingface repo which hosts
this model
type: string
maxContextLength:
description: MaxContextLength defines the max context length allowed
in this model
type: integer
modelScopeRepo:
description: ModelScopeRepo defines the modelscope repo which hosts
this model
type: string
source:
description: Source define the source of the model file
properties:
Expand Down
5 changes: 5 additions & 0 deletions controllers/base/model_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,11 @@ func (r *ModelReconciler) Initialize(ctx context.Context, logger logr.Logger, in
instanceDeepCopy.Labels[arcadiav1alpha1.LabelModelLLM] = isLLMModel
update = true
}
isReranking := strconv.FormatBool(instanceDeepCopy.IsRerankingModel())
if v := instanceDeepCopy.Labels[arcadiav1alpha1.LabelModelReranking]; v != isReranking {
instanceDeepCopy.Labels[arcadiav1alpha1.LabelModelReranking] = isReranking
update = true
}

// Initialize annotations
if instanceDeepCopy.Annotations == nil {
Expand Down
2 changes: 1 addition & 1 deletion deploy/charts/arcadia/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: arcadia
description: A Helm chart(Also a KubeBB Component) for KubeAGI Arcadia
type: application
version: 0.2.34
version: 0.2.35
appVersion: "0.1.0"

keywords:
Expand Down
12 changes: 12 additions & 0 deletions deploy/charts/arcadia/crds/arcadia.kubeagi.k8s.com.cn_models.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,18 @@ spec:
displayName:
description: DisplayName defines datasource display name
type: string
huggingFaceRepo:
description: HuggingFaceRepo defines the huggingface repo which hosts
this model
type: string
maxContextLength:
description: MaxContextLength defines the max context length allowed
in this model
type: integer
modelScopeRepo:
description: ModelScopeRepo defines the modelscope repo which hosts
this model
type: string
source:
description: Source define the source of the model file
properties:
Expand Down
30 changes: 29 additions & 1 deletion deploy/charts/arcadia/templates/post-models.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,13 @@ spec:
官网: https://www.baichuan-ai.com/
Github: https://github.com/baichuan-inc/Baichuan2
HuggingFace: https://huggingface.co/baichuan-inc/Baichuan2-7B-Chat
ModelScope: https://modelscope.cn/models/baichuan-inc/Baichuan2-7B-Chat/summary
ModelScope: https://modelscope.cn/models/baichuan-inc/Baichuan2-7B-Chat
arXiv: https://arxiv.org/abs/2309.10305
百川智能成立于2023年4月10日,由前搜狗公司CEO王小川创立。公司以帮助大众轻松、普惠地获取世界知识和专业服务为使命,致力于通过语言AI的突破,构建中国最优秀的大模型底座。
types: "llm"
huggingFaceRepo: baichuan-inc/Baichuan2-7B-Chat
modelScopeRepo: baichuan-inc/Baichuan2-7B-Chat
---
apiVersion: arcadia.kubeagi.k8s.com.cn/v1alpha1
kind: Model
Expand Down Expand Up @@ -56,6 +58,8 @@ spec:
北京智谱华章科技有限公司由清华大学计算机系技术成果转化而来,致力于打造新一代认知智能大模型,专注于做大模型的中国创新。
types: "llm"
huggingFaceRepo: THUDM/chatglm2-6b
modelScopeRepo: ZhipuAI/chatglm2-6b
---
apiVersion: arcadia.kubeagi.k8s.com.cn/v1alpha1
kind: Model
Expand Down Expand Up @@ -88,6 +92,8 @@ spec:
通义为阿里云大模型的统一品牌,覆盖语言、听觉、多模态等领域,致力于实现类人智慧的通用智能。
types: "llm"
huggingFaceRepo: Qwen/Qwen-7B-Chat
modelScopeRepo: qwen/Qwen-7B-Chat
---
apiVersion: arcadia.kubeagi.k8s.com.cn/v1alpha1
kind: Model
Expand Down Expand Up @@ -120,4 +126,26 @@ spec:
北京智源人工智能研究院是北京大学的直属研究机构,主要从事人工智能的数理基础、机器学习、智能信息检索与挖掘、智能体系架构与芯片、自然语言处理等领域研究。
types: "embedding"
huggingFaceRepo: BAAI/bge-large-zh-v1.5
---
apiVersion: arcadia.kubeagi.k8s.com.cn/v1alpha1
kind: Model
metadata:
name: bge-reranker-large
namespace: {{ .Release.Namespace }}
annotations:
"helm.sh/hook": post-install
"helm.sh/hook-weight": "1"
spec:
displayName: "bge-reranker-large"
description: |
bge-raranker-large 是一个通用reranking,由北京智源人工智能研究院(BAAI)推出,同时支持中英文
官网: https://www.baai.ac.cn/
Github: https://github.com/FlagOpen/FlagEmbedding
HuggingFace: https://huggingface.co/BAAI/bge-reranker-large
arXiv: https://arxiv.org/pdf/2309.07597
北京智源人工智能研究院是北京大学的直属研究机构,主要从事人工智能的数理基础、机器学习、智能信息检索与挖掘、智能体系架构与芯片、自然语言处理等领域研究。
types: "reranking"
huggingFaceRepo: BAAI/bge-reranker-large

0 comments on commit 3132ba8

Please sign in to comment.