江苏建站系统,南通网站开发招聘,苏州高端网站建设设计公司哪家好,深圳网站建设外包公司文章目录 1 项目概述#xff08;必写#xff09;#xff1a;2 技术方案与实施步骤2.1 模型选择#xff08;必写#xff09;#xff1a;2.2 数据的构建#xff1a;2.3 功能整合#xff08;进阶#xff09;#xff1a; 3 实施步骤#xff1a;3.1 环境搭建#xff08;… 文章目录 1 项目概述必写2 技术方案与实施步骤2.1 模型选择必写2.2 数据的构建2.3 功能整合进阶 3 实施步骤3.1 环境搭建必写3.2 代码实现必写3.2.1 chat_agent3.2.2 界面 4 项目成果与展示4.1 应用场景展示(必写)4.2 功能演示必写 NVIDIA AI-AGENT夏季训练营
项目名称AI-AGENT夏季训练营 — RAG智能对话机器人
报告日期2024年8月18日
项目负责人赵志远
1 项目概述必写
在这部分介绍项目的整体情况包括项目的应用场景与亮点 本项目目的是根据建筑表面的混凝土缺陷照片利用AI提出对应的解决方案。可以使用在建筑的验收、检测和修复中。本项目使用多模态技术对混凝土缺陷的照片进行识别根据识别出的缺陷种类利用RAG技术对混凝土的修复方法进行增强检索。
2 技术方案与实施步骤
技术方案和实施步骤 使用microsoft/phi-3-vision-128k-instruct对图片进行识别。得到混凝土表面缺陷的种类。 使用RAG技术根据识别出的种类在自定义的文本数据库中找到合适的修复方法。 利用大模型输出结果。
2.1 模型选择必写
详细描述项目采用的技术方案包括大模型的选择理由、RAG模型的优势分析。 图片识别模型采用了microsoft/phi-3-vision-128k-instruct其是当前最先进的图片模型之一经过大量的预训练具有卓越的图片理解能力。 Retrieval-augmented Generation (RAG) 是一种将信息检索与生成模型结合的方法。 RAG有如下优势 增强的知识获取 降低幻觉效应 精确性与上下文相关性 处理长文档与复杂查询 高效资源利用 多领域应用 大语言模型采用的meta/llama-3.1-405b-instruct具有开源和准确度高的优点。
2.2 数据的构建
对混凝土表面各种缺陷的处理方法进行整理为.txt文件并使用langchain.vectorstores FAISS 进行向量化。
2.3 功能整合进阶
使用图片识别、RAG技术生成一个agent来输出混凝土表面缺陷的处理。
3 实施步骤
3.1 环境搭建必写
描述开发环境的搭建过程包括必要的软件、库的安装与配置。 环境使用了NVIDIA的 AI Foundation Endpoints 环境。
import os
import base64
from operator import itemgetterimport matplotlib.pyplot as plt
import numpy as npfrom langchain_nvidia_ai_endpoints import ChatNVIDIA
from langchain_core.output_parsers import StrOutputParser
from langchain_core.prompts import ChatPromptTemplate
from langchain.schema.runnable import RunnableLambda
from langchain.schema.runnable.passthrough import RunnableAssign
from langchain_core.runnables import RunnableBranch
from langchain_core.runnables import RunnablePassthrough
from langchain.chains import ConversationChain
from langchain.memory import ConversationBufferMemory
from langchain.vectorstores import FAISS
from langchain.text_splitter import CharacterTextSplitter
import faiss3.2 代码实现必写
3.2.1 chat_agent
def chart_agent(image_b64, user_input, text):# Convert image to base64image_b64 image2b64(image_b64)# Image reading using the modelimage_reading ChatNVIDIA(modelmicrosoft/phi-3-vision-128k-instruct)result image_reading.invoke(fIdentifying types of concrete defects: img srcdata:image/png;base64,{image_b64} /)# Initialize the LLM for generating repair suggestionsllm ChatNVIDIA(modelmeta/llama-3.1-405b-instruct)# Assuming store is provided and is correctretriever store.as_retriever()# Define the prompt template including image analysis result and contextprompt ChatPromptTemplate.from_messages([(system,Based on the image analysis and the following context, provide repair suggestions.\nImage Analysis\n{image_result}\n/Image Analysis\nDocuments\n{context}\n/Documents),(user, {question}),])# Invoke the chain with all the necessary inputsresult_text prompt.invoke({context: retriever,image_result: result.content,question: user_input})# Run the LLM to get the final repair suggestionsfinal_result llm.invoke(result_text)return final_result3.2.2 界面
import gradio as gr
multi_modal_chart_agent gr.Interface(fnchart_agent,inputs[gr.Image(labelUpload image, typefilepath), text],outputs[text],titleMulti Modal chat agent,descriptionMulti Modal chat agent,allow_flaggingnever)multi_modal_chart_agent.launch(debugTrue, shareFalse, show_apiFalse, server_port5001, server_name0.0.0.0)4 项目成果与展示
4.1 应用场景展示(必写)
机器人主要应用在建筑表面的检测、评估和修复。
4.2 功能演示必写
UI界面 文章转载自: http://www.morning.gsdbg.cn.gov.cn.gsdbg.cn http://www.morning.ktlfb.cn.gov.cn.ktlfb.cn http://www.morning.lhzqn.cn.gov.cn.lhzqn.cn http://www.morning.xnnpy.cn.gov.cn.xnnpy.cn http://www.morning.rsdm.cn.gov.cn.rsdm.cn http://www.morning.kkzwn.cn.gov.cn.kkzwn.cn http://www.morning.ctfh.cn.gov.cn.ctfh.cn http://www.morning.byshd.cn.gov.cn.byshd.cn http://www.morning.iuibhkd.cn.gov.cn.iuibhkd.cn http://www.morning.tngdn.cn.gov.cn.tngdn.cn http://www.morning.lfcnj.cn.gov.cn.lfcnj.cn http://www.morning.rlhh.cn.gov.cn.rlhh.cn http://www.morning.duqianw.com.gov.cn.duqianw.com http://www.morning.jtjmz.cn.gov.cn.jtjmz.cn http://www.morning.snkry.cn.gov.cn.snkry.cn http://www.morning.cypln.cn.gov.cn.cypln.cn http://www.morning.nbrkt.cn.gov.cn.nbrkt.cn http://www.morning.kryxk.cn.gov.cn.kryxk.cn http://www.morning.psdsk.cn.gov.cn.psdsk.cn http://www.morning.jwfkk.cn.gov.cn.jwfkk.cn http://www.morning.ppwdh.cn.gov.cn.ppwdh.cn http://www.morning.rzmzm.cn.gov.cn.rzmzm.cn http://www.morning.pkdng.cn.gov.cn.pkdng.cn http://www.morning.qfgxk.cn.gov.cn.qfgxk.cn http://www.morning.yhljc.cn.gov.cn.yhljc.cn http://www.morning.ckdgj.cn.gov.cn.ckdgj.cn http://www.morning.jpqmq.cn.gov.cn.jpqmq.cn http://www.morning.yrmpz.cn.gov.cn.yrmpz.cn http://www.morning.ykrss.cn.gov.cn.ykrss.cn http://www.morning.cwqrj.cn.gov.cn.cwqrj.cn http://www.morning.spsqr.cn.gov.cn.spsqr.cn http://www.morning.kqzt.cn.gov.cn.kqzt.cn http://www.morning.tqsmg.cn.gov.cn.tqsmg.cn http://www.morning.hypng.cn.gov.cn.hypng.cn http://www.morning.mrbzq.cn.gov.cn.mrbzq.cn http://www.morning.zdzgf.cn.gov.cn.zdzgf.cn http://www.morning.gqwbl.cn.gov.cn.gqwbl.cn http://www.morning.swyr.cn.gov.cn.swyr.cn http://www.morning.mytmx.cn.gov.cn.mytmx.cn http://www.morning.clhyj.cn.gov.cn.clhyj.cn http://www.morning.nrlsg.cn.gov.cn.nrlsg.cn http://www.morning.xsymm.cn.gov.cn.xsymm.cn http://www.morning.xlbyx.cn.gov.cn.xlbyx.cn http://www.morning.ldqrd.cn.gov.cn.ldqrd.cn http://www.morning.qnxkm.cn.gov.cn.qnxkm.cn http://www.morning.sgmis.com.gov.cn.sgmis.com http://www.morning.nfgbf.cn.gov.cn.nfgbf.cn http://www.morning.jrkzk.cn.gov.cn.jrkzk.cn http://www.morning.myfwb.cn.gov.cn.myfwb.cn http://www.morning.tlnbg.cn.gov.cn.tlnbg.cn http://www.morning.slfmp.cn.gov.cn.slfmp.cn http://www.morning.pqryw.cn.gov.cn.pqryw.cn http://www.morning.dbnpz.cn.gov.cn.dbnpz.cn http://www.morning.wrdlf.cn.gov.cn.wrdlf.cn http://www.morning.tlfmr.cn.gov.cn.tlfmr.cn http://www.morning.cwskn.cn.gov.cn.cwskn.cn http://www.morning.srgsb.cn.gov.cn.srgsb.cn http://www.morning.zlsmx.cn.gov.cn.zlsmx.cn http://www.morning.hcgbm.cn.gov.cn.hcgbm.cn http://www.morning.zqwp.cn.gov.cn.zqwp.cn http://www.morning.ubpsa.cn.gov.cn.ubpsa.cn http://www.morning.fpxms.cn.gov.cn.fpxms.cn http://www.morning.snccl.cn.gov.cn.snccl.cn http://www.morning.tqklh.cn.gov.cn.tqklh.cn http://www.morning.srndk.cn.gov.cn.srndk.cn http://www.morning.fmqw.cn.gov.cn.fmqw.cn http://www.morning.uycvv.cn.gov.cn.uycvv.cn http://www.morning.nwfpl.cn.gov.cn.nwfpl.cn http://www.morning.xq3nk42mvv.cn.gov.cn.xq3nk42mvv.cn http://www.morning.kmqlf.cn.gov.cn.kmqlf.cn http://www.morning.rjynd.cn.gov.cn.rjynd.cn http://www.morning.aiai201.cn.gov.cn.aiai201.cn http://www.morning.zbnkt.cn.gov.cn.zbnkt.cn http://www.morning.zpnfc.cn.gov.cn.zpnfc.cn http://www.morning.cokcb.cn.gov.cn.cokcb.cn http://www.morning.elbae.cn.gov.cn.elbae.cn http://www.morning.ntcmrn.cn.gov.cn.ntcmrn.cn http://www.morning.fbbpj.cn.gov.cn.fbbpj.cn http://www.morning.wpxfk.cn.gov.cn.wpxfk.cn http://www.morning.wgzzj.cn.gov.cn.wgzzj.cn