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
161 lines (161 loc) · 4.14 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
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.*)'
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: 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
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搭建对话模型