diff --git a/README-CN.md b/README-CN.md index 67ddadee..9e98a274 100644 --- a/README-CN.md +++ b/README-CN.md @@ -448,6 +448,7 @@ ROS 模板的示例和最佳实践。模板分类如下: | [pai-lingjun-serverless-LLM-best-practice.yml](documents/solution/ai/upai-lingjun-serverless-LLM-best-practice.yml) | PAI灵骏智算资源(Serverless版)大模型最佳实践。 | | [use-gpu-ecs-to-deploy-chatGLM.yaml](documents/solution/ai/use-gpu-ecs-to-deploy-chatGLM.yaml) | 向量数据库构建企业智能知识库。 | [解决方案](https://aliyun.com/solution/tech-solution/baeeikb) | | [build-a-dialogue-model-based-on-ChatGLM-and-LangChain.yml](documents/solution/ai/build-a-dialogue-model-based-on-ChatGLM-and-LangChain.yml) | 基于ChatGLM和LangChain搭建对话模型。| [解决方案](https://www.aliyun.com/solution/tech-solution/calbadm) | +| [build-a-dialogue-model-based-on-Qwen-and-LangChain.yml](documents/solution/ai/build-a-dialogue-model-based-on-Qwen-and-LangChain.yml) | 基于通义千问和LangChain搭建对话模型。| | [ack-ai-fine-tuning.yml](documents/solution/ai/ack-ai-fine-tuning.yml) | 使用云原生AI套件提交模型微调训练任务与部署GPU共享推理服务。 | - data-analysis diff --git a/README.md b/README.md index ad263c31..54391769 100644 --- a/README.md +++ b/README.md @@ -450,6 +450,7 @@ Examples and best practices of ROS templates. The templates are categorized as f | [use-pai-to-deploy-stable-diffusion-for-AI-painting.yml](documents/solution/ai/use-pai-to-deploy-stable-diffusion-for-AI-painting.yml) | How to quickly start Stable Diffusion on Alibaba Cloud and easily play with AI painting. | | [use-gpu-ecs-to-deploy-chatGLM.yaml](documents/solution/ai/use-gpu-ecs-to-deploy-chatGLM.yaml) | Large model combines the AnalyticDB to build Chatbot. | | [build-a-dialogue-model-based-on-ChatGLM-and-LangChain.yml](documents/solution/ai/build-a-dialogue-model-based-on-ChatGLM-and-LangChain.yml) | Build a dialogue model based on ChatGLM and LangChain. | +| [build-a-dialogue-model-based-on-Qwen-and-LangChain.yml](documents/solution/ai/build-a-dialogue-model-based-on-Qwen-and-LangChain.yml) | Build a dialogue model based on Qwen and LangChain. | | [ack-ai-fine-tuning.yml](documents/solution/ai/ack-ai-fine-tuning.yml) | Use the cloud-native AI suite to submit model fine-tuning training tasks and deploy GPU shared inference services. | diff --git a/documents/solution/ai/build-a-dialogue-model-based-on-Qwen-and-LangChain.yml b/documents/solution/ai/build-a-dialogue-model-based-on-Qwen-and-LangChain.yml new file mode 100644 index 00000000..c3f41114 --- /dev/null +++ b/documents/solution/ai/build-a-dialogue-model-based-on-Qwen-and-LangChain.yml @@ -0,0 +1,236 @@ +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 + networking: + vswitch_id: + Ref: VSwitch + security_group_id: + Ref: SecurityGroup + vpc_id: + Ref: Vpc + containers: + - image: + Fn::Sub: + - 'eas-registry-vpc.${Region}.cr.aliyuncs.com/pai-eas/chat-llm-webui:2.0' + - 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搭建对话模型 \ No newline at end of file