当前位置: 首页 > news >正文

黄山建设网站公司电话网站下载链接怎么做

黄山建设网站公司电话,网站下载链接怎么做,网站建设的钱计入什么科目,京东旗下的企业网站有哪些【 书生浦语大模型实战营】作业#xff08;六#xff09;#xff1a;Lagent AgentLego 智能体应用搭建 #x1f389;AI学习星球推荐#xff1a; GoAI的学习社区 知识星球是一个致力于提供《机器学习 | 深度学习 | CV | NLP | 大模型 | 多模态 | AIGC 》各个最新AI方…【 书生·浦语大模型实战营】作业六Lagent AgentLego 智能体应用搭建 AI学习星球推荐 GoAI的学习社区 知识星球是一个致力于提供《机器学习 | 深度学习 | CV | NLP | 大模型 | 多模态 | AIGC 》各个最新AI方向综述、论文等成体系的学习资料配有全面而有深度的专栏内容包括不限于 前沿论文解读、资料共享、行业最新动态以、实践教程、求职相关简历撰写技巧、面经资料与心得多方面综合学习平台强烈推荐AI小白及AI爱好者学习性价比非常高加入星球➡️点击链接 【 书生·浦语大模型实战营】作业六Lagent AgentLego 智能体应用搭建 本篇笔记内容主要为 【书生·浦语大模型实战营】作业六Lagent AgentLego 智能体应用搭建智能体的作业 主要对智能体应用理论部分及具体搭建流程详细介绍并分别进行实战应用及可视化展示欢迎大家交流学习 本次学习资料 1.【视频】Lagent AgentLego 智能体应用搭建 2.【文档】https://github.com/InternLM/Tutorial/blob/camp2/agent/lagent.md#1-lagent-web-demo 3.【作业】https://github.com/InternLM/Tutorial 本次作业内容 完成 Lagent Web Demo 使用并在作业中上传截图。 完成 AgentLego 直接使用部分并在作业中上传截图。 1.1 Lagent轻量级智能体框架 安装环境 # 新建环境 mkdir -p /root/agent studio-conda -t agent -o pytorch-2.1.2#下载github有关仓库 cd /root/agent git clone https://gitee.com/internlm/agentlego.git git clone https://gitee.com/internlm/lagent.git git clone -b camp2 https://gitee.com/internlm/Tutorial.git# 激活环境并安装对应工具包 conda activate agent cd lagent git checkout 581d9fb pip install -e . cd .. cd agentlego git checkout 7769e0d pip install -e . cd .. pip install lmdeploy0.3.01.2 Lagent轻量级智能体框架 Lagent Web Demo conda activate agent lmdeploy serve api_server /root/share/new_models/Shanghai_AI_Laboratory/internlm2-chat-7b \--server-name 127.0.0.1 \--model-name internlm2-chat-7b \--cache-max-entry-count 0.12.启动并使用 Lagent Web Demo 新建的 terminal 中执行下述命令启动 Lagent Web Demo conda activate agent cd /root/agent/lagent/examples streamlit run internlm2_agent_web_demo.py --server.address 127.0.0.1 --server.port 7860在等待 LMDeploy 的 api_server 与 Lagent Web Demo 完全启动后在本地进行端口映射将 LMDeploy api_server 的23333端口以及 Lagent Web Demo 的7860端口映射到本地。执行 ssh -CNg -L 7860:127.0.0.1:7860 -L 23333:127.0.0.1:23333 rootssh.intern-ai.org.cn -p 你的 ssh 41562效果 1.3 用 Lagent 自定义工具 使用 Lagent 自定义工具主要分为以下几步 继承 BaseAction 类 实现简单工具的 run 方法或者实现工具包内每个子工具的功能 简单工具的 run 方法可选被 tool_api 装饰工具包内每个子工具的功能都需要被 tool_api 装饰 目标实现一个调用和风天气 API 的工具以完成实时天气查询的功能 重启服务 conda activate agent lmdeploy serve api_server /root/share/new_models/Shanghai_AI_Laboratory/internlm2-chat-7b \--server-name 127.0.0.1 \--model-name internlm2-chat-7b \--cache-max-entry-count 0.1 export WEATHER_API_KEY获取的API KEY conda activate agent cd /root/agent/Tutorial/agent streamlit run internlm2_weather_web_demo.py --server.address 127.0.0.1 --server.port 7860#本地进行端口映射 ssh -CNg -L 7860:127.0.0.1:7860 -L 23333:127.0.0.1:23333 rootssh.intern-ai.org.cn -p 41562 效果 2.1 AgentLego组装智能体“乐高” 直接使用 AgentLego cd /root/agent wget http://download.openmmlab.com/agentlego/road.jpg conda activate agent pip install openmim0.3.9 mim install mmdet3.3.0python /root/agent/direct_use.py 推理前 Inference truck (345, 428, 528, 599), score 83 car (771, 510, 837, 565), score 81 car (604, 518, 677, 569), score 75 person (866, 503, 905, 595), score 74 person (287, 513, 320, 596), score 74 person (964, 501, 999, 604), score 72 person (1009, 503, 1047, 602), score 69 person (259, 510, 279, 575), score 65 car (1074, 524, 1275, 691), score 64 person (993, 508, 1016, 597), score 62 truck (689, 483, 764, 561), score 62 bicycle (873, 551, 903, 602), score 60 person (680, 523, 699, 567), score 55 bicycle (968, 551, 996, 609), score 53 bus (826, 482, 930, 560), score 52 bicycle (1011, 551, 1043, 617), score 51 推理后 2.2 智能体工具使用 使用 AgentLego WebUI 在本地的浏览器页面中打开http://localhost:7860以使用 AgentLego WebUI。 效果 2.3 自定义工具 基于 AgentLego 构建自己的自定义工具文档教程自定义工具主要分为以下几步 继承 BaseTool 类 修改 default_desc 属性工具功能描述 如有需要重载 setup 方法重型模块延迟加载 重载 apply 方法工具功能实现 通过touch /root/agent/agentlego/agentlego/tools/magicmaker_image_generation.py大小写敏感的方法新建工具文件。该文件的内容如下 import json import requestsimport numpy as npfrom agentlego.types import Annotated, ImageIO, Info from agentlego.utils import require from .base import BaseToolclass MagicMakerImageGeneration(BaseTool):default_desc (This tool can call the api of magicmaker to generate an image according to the given keywords.)styles_option [dongman, # 动漫guofeng, # 国风xieshi, # 写实youhua, # 油画manghe, # 盲盒]aspect_ratio_options [16:9, 4:3, 3:2, 1:1,2:3, 3:4, 9:16]require(opencv-python)def __init__(self,styleguofeng,aspect_ratio4:3):super().__init__()if style in self.styles_option:self.style styleelse:raise ValueError(fThe style must be one of {self.styles_option})if aspect_ratio in self.aspect_ratio_options:self.aspect_ratio aspect_ratioelse:raise ValueError(fThe aspect ratio must be one of {aspect_ratio})def apply(self,keywords: Annotated[str,Info(A series of Chinese keywords separated by comma.)]) - ImageIO:import cv2response requests.post(urlhttps://magicmaker.openxlab.org.cn/gw/edit-anything/api/v1/bff/sd/generate,datajson.dumps({official: True,prompt: keywords,style: self.style,poseT: False,aspectRatio: self.aspect_ratio}),headers{content-type: application/json})image_url response.json()[data][imgUrl]image_response requests.get(image_url)image cv2.cvtColor(cv2.imdecode(np.frombuffer(image_response.content, np.uint8), cv2.IMREAD_COLOR),cv2.COLOR_BGR2RGB)return ImageIO(image)注册新工具在重复2.2步骤即可运行结果。
http://www.pierceye.com/news/403134/

相关文章:

  • 开发企业网站多少钱电视剧排行榜百度搜索风云榜
  • 什么网站做软文装修公司报价如何计算
  • 网站开发免费视频播放器应用公园app免费制作
  • 道路建设去什么网站能看到做内贸注册什么网站
  • 代理东莞网站制作公司wordpress前台用户中心代码
  • 做拼团网站下载wap浏览器
  • 网站建设合同文百科阿里云加WordPress建站
  • 服装购物网站排名ppt制作神器
  • 长沙营销策划公司排名如何优化企业网站
  • 北京制卡厂家做卡公司北京制卡网站_北京制卡_北京 去114网wordpress 关闭注册
  • 网站建设技术优势广州天河区医院
  • python和php网站开发中国十大公司排行榜
  • 网站栅格如何建设一个外卖订餐平台网站
  • 浙江省网站建设报价群晖wordpress不成功
  • 音乐网站制作策划书网站建设公司的服务公司
  • 南昌定制网站开发多少钱手机在线网页制作
  • 无锡网站推广$做下拉去118cr高端网站建设苏州
  • 该网站未在腾讯云备案网页界面图
  • cms开源建站系统河北省建设厅管网站
  • 网站优化排名易下拉技术做官网的步骤
  • 网站备案多久服装企业 北京 网站建设
  • 网站建设(信奈辉煌电商)陕西富通建设工程有限公司网站
  • 南昌县住房和城乡建设局网站外海网站如何做网站的推广
  • 重庆网站推广报价wordpress全景图
  • 做那个的网站谁有建立什么指标体系和评价程序规范
  • 新旧网站对比全国建设厅网站
  • 有经验的番禺网站建设做球服的网站有哪些
  • 临泉建设网站互联网行业都有哪些工作
  • 甘肃省嘉峪关建设局网站做游戏交易网站
  • 校园网站做自己的广告惠州网络问政平台官网