Skip to content

Commit

Permalink
chore: use same common spec in worker's llm/worker
Browse files Browse the repository at this point in the history
Signed-off-by: bjwswang <[email protected]>
  • Loading branch information
bjwswang committed Dec 27, 2023
1 parent ed4e8d8 commit 415d607
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 26 deletions.
18 changes: 4 additions & 14 deletions api/base/v1alpha1/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,13 +158,8 @@ func (worker Worker) BuildEmbedder() *Embedder {
Name: worker.Name,
},
Spec: EmbedderSpec{
CommonSpec: CommonSpec{
Creator: worker.Spec.Creator,
// Use the model name as the displayname
DisplayName: worker.Spec.Model.Name,
Description: "Embedder created by Worker(OpenAI compatible)",
},
Type: embeddings.OpenAI,
CommonSpec: worker.Spec.CommonSpec,
Type: embeddings.OpenAI,
Provider: Provider{
Worker: &TypedObjectReference{
Kind: "Worker",
Expand All @@ -183,13 +178,8 @@ func (worker Worker) BuildLLM() *LLM {
Name: worker.Name,
},
Spec: LLMSpec{
CommonSpec: CommonSpec{
Creator: worker.Spec.Creator,
// Use the model name as the displayname
DisplayName: worker.Spec.Model.Name,
Description: "LLM created by Worker(OpenAI compatible)",
},
Type: llms.OpenAI,
CommonSpec: worker.Spec.CommonSpec,
Type: llms.OpenAI,
Provider: Provider{
Worker: &TypedObjectReference{
Kind: "Worker",
Expand Down
2 changes: 2 additions & 0 deletions config/samples/arcadia_v1alpha1_worker_baichuan2-7b.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ metadata:
name: baichuan2-7b-chat
namespace: arcadia
spec:
displayName: 百川7B对话模型服务
description: "这是一个对话模型服务,由百川提供"
type: "fastchat"
model:
kind: "Models"
Expand Down
14 changes: 3 additions & 11 deletions config/samples/arcadia_v1alpha1_worker_bge-large-zh-v1.5.yaml
Original file line number Diff line number Diff line change
@@ -1,19 +1,11 @@
apiVersion: arcadia.kubeagi.k8s.com.cn/v1alpha1
kind: Model
metadata:
name: bge-large-zh-v1.5
namespace: arcadia
spec:
displayName: "bge-large-zh-v1.5"
description: "智源研究员发布的Embedding模型"
types: "embedding"
---
apiVersion: arcadia.kubeagi.k8s.com.cn/v1alpha1
\apiVersion: arcadia.kubeagi.k8s.com.cn/v1alpha1
kind: Worker
metadata:
name: bge-large-zh
namespace: arcadia
spec:
displayName: BGE模型服务
description: "这是一个Embedding模型服务,由BGE提供"
type: "fastchat"
replicas: 1
model:
Expand Down
4 changes: 3 additions & 1 deletion config/samples/arcadia_v1alpha1_worker_qwen-7b-chat.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ apiVersion: arcadia.kubeagi.k8s.com.cn/v1alpha1
kind: Worker
metadata:
name: qwen-7b-chat
namespace: kubeagi-system
namespace: arcadia
spec:
displayName: 通义千问7B对话
description: "这是一个对话模型服务,由通义千问提供"
type: "fastchat"
model:
kind: "Models"
Expand Down

0 comments on commit 415d607

Please sign in to comment.