forked from aliyun/ros-templates
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build-a-dialogue-model-based-on-Qwen-and-LangChain.yml
229 lines (229 loc) · 5.75 KB
/
build-a-dialogue-model-based-on-Qwen-and-LangChain.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
ROSTemplateFormatVersion: '2015-09-01'
Description:
en: Build a dialogue model based on Qwen and LangChain.
zh-cn: 基于通义千问和LangChain搭建对话模型。
Parameters:
ZoneId:
Type: String
Label:
en: VSwitch Availability Zone
zh-cn: 可用区
Description:
en: Availability Zone ID
zh-cn: 可用区ID。
AssociationProperty: ZoneId
PAIEASInstanceType:
Type: String
Label:
en: PAI-EAS instance type.
zh-cn: PAI-EAS实例规格
Description:
en: PAI-EAS instance type.
zh-cn: PAI-EAS 使用的实例规格。
AllowedPattern: '(^ecs.*gn.*)|(^ml.*)'
Resources:
RandomString:
Type: ALIYUN::RandomString
Properties:
length: 8
character_classes:
- class: lowercase
min: 1
- class: digits
min: 1
EnablePAI:
Type: ALIYUN::ROS::AutoEnableService
Properties:
ServiceName: PAI
Vpc:
Type: ALIYUN::ECS::VPC
DependsOn:
- EnablePAI
Properties:
CidrBlock: 192.168.0.0/16
VSwitch:
Type: ALIYUN::ECS::VSwitch
Properties:
ZoneId:
Ref: ZoneId
VpcId:
Ref: Vpc
CidrBlock: 192.168.0.0/24
SecurityGroup:
Type: ALIYUN::ECS::SecurityGroup
Properties:
VpcId:
Ref: Vpc
SecurityGroupIngress:
- PortRange: 22/22
Priority: 1
SourceCidrIp: 0.0.0.0/0
IpProtocol: tcp
NicType: internet
- PortRange: 80/80
Priority: 1
SourceCidrIp: 0.0.0.0/0
IpProtocol: tcp
NicType: internet
- PortRange: 443/443
Priority: 1
SourceCidrIp: 0.0.0.0/0
IpProtocol: tcp
NicType: internet
- PortRange: 3389/3389
Priority: 1
SourceCidrIp: 0.0.0.0/0
IpProtocol: tcp
NicType: internet
NasFileSystem:
Type: ALIYUN::NAS::FileSystem
Properties:
ProtocolType: NFS
FileSystemType: standard
StorageType: Performance
DeletionForce: true
ZoneId:
Ref: ZoneId
VpcId:
Ref: Vpc
VSwitchId:
Ref: VSwitch
AliyunFCServerlessDevsRole:
Type: ALIYUN::RAM::Role
Properties:
RoleName: AliyunFCServerlessDevsRole
Description: 应用中心需要您的角色中包含应用所需策略,推荐创建并使用系统默认角色 AliyunFCServerlessDevsRole。
AssumeRolePolicyDocument:
Version: '1'
Statement:
- Action: sts:AssumeRole
Effect: Allow
Principal:
Service:
- fc.aliyuncs.com
MaxSessionDuration: 3600
IgnoreExisting: true
DeletionForce: true
PolicyAttachments:
System:
- AliyunNASFullAccess
- AliyunFCFullAccess
- AliyunFCServerlessDevsRolePolicy
- AliyunOSSReadOnlyAccess
- AliyunECSReadOnlyAccess
- AliyunVPCReadOnlyAccess
- AliyunLogReadOnlyAccess
NasAccessGroup:
Type: ALIYUN::NAS::AccessGroup
Properties:
AccessGroupType: Vpc
AccessGroupName:
Fn::Sub: nas-access-group-${ALIYUN::StackId}
NasMountTarget:
Type: ALIYUN::NAS::MountTarget
DependsOn:
- NasAccessRule
Properties:
VpcId:
Ref: Vpc
VSwitchId:
Ref: VSwitch
NetworkType: Vpc
AccessGroupName:
Ref: NasAccessGroup
FileSystemId:
Ref: NasFileSystem
NasAccessRule:
Type: ALIYUN::NAS::AccessRule
Properties:
SourceCidrIp: 0.0.0.0/0
AccessGroupName:
Ref: NasAccessGroup
FCApplication:
Type: ALIYUN::FC::Application
Properties:
Name:
Fn::Sub: start-nas-ui-${ALIYUN::StackId}
RoleARN:
Fn::GetAtt:
- AliyunFCServerlessDevsRole
- Arn
Parameters:
serviceName:
Fn::Sub: nas-filemgr-${ALIYUN::StackId}
functionName: kodbox
region:
Ref: ALIYUN::Region
vpcId:
Ref: Vpc
vswitchId:
Ref: VSwitch
securityGroupId:
Ref: SecurityGroup
mountPointsServerAddr:
Fn::GetAtt:
- NasMountTarget
- MountTargetDomain
Template: start-nas-ui
AutoDeploy: true
Workspace:
Type: ALIYUN::PAI::Workspace
DependsOn:
- EnablePAI
Properties:
EnvTypes:
- dev
- prod
Description: Build a dialogue model based on Qwen and LangChain.
WorkspaceName:
Fn::Sub: qwen_demo_${RandomString.value}
EAS:
Type: ALIYUN::PAI::Service
Properties:
ServiceConfig:
metadata:
name:
Fn::Sub: qwen_demo_${RandomString.value}
instance: 1
enable_webservice: true
cloud:
computing:
instance_type:
Ref: PAIEASInstanceType
instances: Null
containers:
- image:
Fn::Sub:
- 'eas-registry-vpc.${Region}.cr.aliyuncs.com/pai-eas/chat-llm-webui:2.1'
- Region:
Ref: ALIYUN::Region
script: 'python webui/webui_server.py --port=8000 --model-path=Qwen/Qwen-7B-Chat'
port: 8000
DependsOn:
- Workspace
Outputs:
Namespace:
Description:
zh-cn: 服务所在的命名空间。
en: The namespace where the service resides.
Value:
Fn::GetAtt:
- EAS
- Namespace
Metadata:
ALIYUN::ROS::Interface:
ParameterGroups:
- Parameters:
- ZoneId
Label:
default:
en: Zone
zh-cn: 可用区
- Parameters:
- PAIEASInstanceType
Label:
default:
en: PAI-EAS
zh-cn: PAI服务
TemplateTags:
- acs:technical-solution:AI:通义千问和LangChain搭建对话模型