Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion example/s-pipeline.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ resources:
alwaysAllocateGPU: false
mode: sync

supplement:
annotations:
modelConfig:
source: modelscope
id: ${env('MODEL_ID', 'iic/SenseVoiceSmall')}
Expand Down
2 changes: 1 addition & 1 deletion example/s.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ resources:
alwaysAllocateGPU: false
mode: sync

supplement:
annotations:
modelConfig:
source: modelscope
id: ${env('MODEL_ID', 'Qwen/Qwen3-32B-AWQ')}
Expand Down
1 change: 1 addition & 0 deletions src/interface/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export interface IProps extends IFunction {
provisionConfig?: IProvisionConfig;
endpoint?: string;
supplement?: any;
annotations?: any;
}

export interface IInputs extends _IInputs {
Expand Down
7 changes: 2 additions & 5 deletions src/subCommands/deploy/impl/function.ts
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ export default class Service extends Base {
* 生成 auto 资源,非 FC 资源,主要指 vpc、nas、log、role(oss mount 挂载点才有)
*/
private async _deployAuto() {
const { region, supplement } = this.inputs.props;
const { region, supplement, annotations } = this.inputs.props;
const { credential } = this.inputs;
const { functionName } = this.local;

Expand Down Expand Up @@ -390,10 +390,7 @@ vpcConfig:
_.set(this.local, 'vpcConfig', vpcConfig);
}
if (nasAuto) {
let modelConfig;
if (!isEmpty(supplement)) {
modelConfig = supplement.modelConfig;
}
let modelConfig = supplement?.modelConfig || annotations?.modelConfig;

logger.write(
yellow(`Created nas resource succeeded, please replace nasConfig: auto in yaml with:
Expand Down
8 changes: 4 additions & 4 deletions src/subCommands/model/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ export class Model {
// 2. 调用 download 接口,若返回一个错误是下载服务已经存在,继续等待 get 轮询。
// 3. 轮询 get 接口
const { credential } = this.inputs;
const { region, supplement } = this.inputs.props;
const { region, supplement, annotations } = this.inputs.props;
const { functionName } = this.local;
const { modelConfig } = supplement;
const modelConfig = supplement?.modelConfig || annotations?.modelConfig;

if (isEmpty(modelConfig)) {
logger.error(`[Download-model] modelConfig is empty.`);
Expand Down Expand Up @@ -110,7 +110,7 @@ nasConfig:
groupId: 0
userId: 0
mountPoints:
- serverAddr: ${mountTargetDomain}:/${functionName}/${supplement.modelConfig.id}
- serverAddr: ${mountTargetDomain}:/${functionName}/${modelConfig.id}
mountDir: /mnt/${functionName}
enableTLS: false\n`),
);
Expand All @@ -120,7 +120,7 @@ mountPoints:
userId: 0,
mountPoints: [
{
serverAddr: `${mountTargetDomain}:/${functionName}/${supplement.modelConfig.id}`,
serverAddr: `${mountTargetDomain}:/${functionName}/${modelConfig.id}`,
mountDir: `/mnt/${functionName}`,
enableTLS: false,
},
Expand Down
Loading