File tree Expand file tree Collapse file tree 5 files changed +9
-11
lines changed
Expand file tree Collapse file tree 5 files changed +9
-11
lines changed Original file line number Diff line number Diff line change @@ -51,7 +51,7 @@ resources:
5151 alwaysAllocateGPU : false
5252 mode : sync
5353
54- supplement :
54+ annotations :
5555 modelConfig :
5656 source : modelscope
5757 id : ${env('MODEL_ID', 'iic/SenseVoiceSmall')}
Original file line number Diff line number Diff line change @@ -58,7 +58,7 @@ resources:
5858 alwaysAllocateGPU : false
5959 mode : sync
6060
61- supplement :
61+ annotations :
6262 modelConfig :
6363 source : modelscope
6464 id : ${env('MODEL_ID', 'Qwen/Qwen3-32B-AWQ')}
Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ export interface IProps extends IFunction {
2020 provisionConfig ?: IProvisionConfig ;
2121 endpoint ?: string ;
2222 supplement ?: any ;
23+ annotations ?: any ;
2324}
2425
2526export interface IInputs extends _IInputs {
Original file line number Diff line number Diff line change @@ -319,7 +319,7 @@ export default class Service extends Base {
319319 * 生成 auto 资源,非 FC 资源,主要指 vpc、nas、log、role(oss mount 挂载点才有)
320320 */
321321 private async _deployAuto ( ) {
322- const { region, supplement } = this . inputs . props ;
322+ const { region, supplement, annotations } = this . inputs . props ;
323323 const { credential } = this . inputs ;
324324 const { functionName } = this . local ;
325325
@@ -390,10 +390,7 @@ vpcConfig:
390390 _ . set ( this . local , 'vpcConfig' , vpcConfig ) ;
391391 }
392392 if ( nasAuto ) {
393- let modelConfig ;
394- if ( ! isEmpty ( supplement ) ) {
395- modelConfig = supplement . modelConfig ;
396- }
393+ let modelConfig = supplement ?. modelConfig || annotations ?. modelConfig ;
397394
398395 logger . write (
399396 yellow ( `Created nas resource succeeded, please replace nasConfig: auto in yaml with:
Original file line number Diff line number Diff line change @@ -57,9 +57,9 @@ export class Model {
5757 // 2. 调用 download 接口,若返回一个错误是下载服务已经存在,继续等待 get 轮询。
5858 // 3. 轮询 get 接口
5959 const { credential } = this . inputs ;
60- const { region, supplement } = this . inputs . props ;
60+ const { region, supplement, annotations } = this . inputs . props ;
6161 const { functionName } = this . local ;
62- const { modelConfig } = supplement ;
62+ const modelConfig = supplement ?. modelConfig || annotations ?. modelConfig ;
6363
6464 if ( isEmpty ( modelConfig ) ) {
6565 logger . error ( `[Download-model] modelConfig is empty.` ) ;
@@ -110,7 +110,7 @@ nasConfig:
110110groupId: 0
111111userId: 0
112112mountPoints:
113- - serverAddr: ${ mountTargetDomain } :/${ functionName } /${ supplement . modelConfig . id }
113+ - serverAddr: ${ mountTargetDomain } :/${ functionName } /${ modelConfig . id }
114114 mountDir: /mnt/${ functionName }
115115 enableTLS: false\n` ) ,
116116 ) ;
@@ -120,7 +120,7 @@ mountPoints:
120120 userId : 0 ,
121121 mountPoints : [
122122 {
123- serverAddr : `${ mountTargetDomain } :/${ functionName } /${ supplement . modelConfig . id } ` ,
123+ serverAddr : `${ mountTargetDomain } :/${ functionName } /${ modelConfig . id } ` ,
124124 mountDir : `/mnt/${ functionName } ` ,
125125 enableTLS : false ,
126126 } ,
You can’t perform that action at this time.
0 commit comments