-
Notifications
You must be signed in to change notification settings - Fork 35
/
Copy pathbuild-a-dialogue-model-based-on-Qwen-and-LangChain.yml
308 lines (308 loc) · 6.4 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
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
ROSTemplateFormatVersion: '2015-09-01'
Description:
zh-cn: 创建VPC环境,配置安全组,搭建NFS文件系统,启用PAI服务,部署基于Qwen和LangChain的对话模型WebUI。
en: Create a VPC environment, configure security groups, set up an NFS file system,
enable PAI services, and deploy a conversation model WebUI based on Qwen and 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.*)'
AssociationProperty: ALIYUN::EAS::Instance::InstanceType
AssociationPropertyMetadata:
SubscriptionType: PayAsYouGo
Resources:
RandomString:
Type: ALIYUN::RandomString
Properties:
length: 8
character_classes:
- class: lowercase
min: 1
- class: digits
min: 1
Vpc:
Type: ALIYUN::ECS::VPC
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: 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
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
Workspace:
Type: ALIYUN::PAI::Workspace
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
- PAIEASInstanceType
TemplateTags:
- acs:technical-solution:AI:通义千问和LangChain搭建对话模型
ALIYUN::ROS::Composer:
2d11b8c0:
Rect:
- 710
- 453
- -185
- 62
- 1
- 0
ResT: Composer::ROSParameter::AlibabaCloud
0c8dc2fb:
Parent: 2d11b8c0
Rect:
- 650
- 360
- -155
- 109
- 2
- 0
ResT: Composer::ROSParameter::Region
71af4092:
Res:
- RandomString
Parent: 0c8dc2fb
Rect:
- 40
- 40
- 388
- 273
- 3
- 0
Label: RandomString_undefined
4e6a1298:
Res:
- Vpc
Parent: 0c8dc2fb
Rect:
- 363
- 230
- -135
- 159
- 3
- 0
b88697fd:
Res:
- NasAccessGroup
Parent: 0c8dc2fb
Rect:
- 40
- 40
- 269
- 273
- 3
- 0
e11302b8:
Res:
- NasAccessRule
Parent: 0c8dc2fb
Rect:
- 40
- 40
- 269
- 374
- 3
- 0
fae54eb2:
Res:
- Workspace
Parent: 0c8dc2fb
Rect:
- 40
- 40
- 388
- 159
- 3
- 0
2828408d:
Res:
- EAS
Parent: 0c8dc2fb
Rect:
- 40
- 40
- 269
- 159
- 3
- 0
00e1a936:
Res:
- VSwitch
Parent: 4e6a1298
Rect:
- 198
- 154
- -115
- 209
- 4
- 0
b82a2358:
Res:
- NasFileSystem
Parent: 00e1a936
Rect:
- 40
- 40
- -85
- 273
- 5
- 0
063202db:
Res:
- NasMountTarget
Parent: 00e1a936
Rect:
- 40
- 40
- -0.0
- 273
- 5
- 0
ddcb1dc4:
Parent: 0c8dc2fb
Edge:
- 063202db
- b88697fd
Line: 0:0:0:gray:0
d0e59a8e:
Parent: 00e1a936
Edge:
- 063202db
- b82a2358
Line: 0:0:0:gray:0
9801be4e:
Parent: 0c8dc2fb
Edge:
- e11302b8
- b88697fd
Line: 0:0:0:gray:0
b04ded57:
Res:
- SecurityGroup
Parent: 4e6a1298
Rect:
- 94
- 80
- 111
- 209
- 12
- 0