赞
踩
▼最近直播超级多,预约保你有收获
—1—
Llama 3 的 RAG 增强
以下 Github 链接展示了从头开始使用 LangGraph 和 Llama3-8B 构建可靠的智能体。它将3种先进 RAG 技术(自适应 RAG、纠正性 RAG和自我 RAG)的思想结合起来,形成 LangGraph 中的单一控制流程。
https://github.com/langchain-ai/langgraph/blob/main/examples/rag/langgraph_rag_agent_llama3_local.ipynb
方式一:自适应 RAG 路由,将问题路由到不同的检索方法。
方式二:纠正性 RAG 后备方案,如果文档与查询不相关,则回退到网页搜索 Web Browser。
方式三:自我 RAG 进行自我纠错,修正包含幻觉或未回答问题的答案。
—2—
Llama 3 的微调增强
众所周知,LLaMA-Factory 微调,已经支持 Llama 3,如下所示:
Github 地址:https://github.com/hiyouga/LLaMA-Factory
另外 Colab 笔记本中将 Llama-3 微调速度提高 2倍以上,链接如下所示:
https://colab.research.google.com/drive/135ced7oHytdxu3N2DNe1Z0kqjyYIkDXp?usp=sharing
—3—
Llama 3 的 Function Calling 增强
目前官方的答复是 Llama 3 暂时不支持 Function Calling 的功能,也就表面看起来不支持 Agent 智能体功能,如下图所示:
不过,经过我们实践摸索,变形支持 Function Calling 函数调用的方法,也就是采用 Function Calling 数据微调后的 Llama 3,Prompt 提示词模板如下图所示:
- <|begin_of_text|><|start_header_id|>function_metadata<|end_header_id|>
-
-
- You have access to the following functions. Use them if required:
- [
- {
- "type": "function",
- "function": {
- "name": "get_stock_price",
- "description": "Get the stock price of an array of stocks",
- "parameters": {
- "type": "object",
- "properties": {
- "names": {
- "type": "array",
- "items": {
- "type": "string"
- },
- "description": "An array of stocks"
- }
- },
- "required": [
- "names"
- ]
- }
- }
- },
- {
- "type": "function",
- "function": {
- "name": "get_big_stocks",
- "description": "Get the names of the largest N stocks by market cap",
- "parameters": {
- "type": "object",
- "properties": {
- "number": {
- "type": "integer",
- "description": "The number of largest stocks to get the names of, e.g. 25"
- },
- "region": {
- "type": "string",
- "description": "The region to consider, can be \"US\" or \"World\"."
- }
- },
- "required": [
- "number"
- ]
- }
- }
- }
- ]<|eot_id|><|start_header_id|>user<|end_header_id|>
-
-
- Get the names of the five largest stocks by market cap<|eot_id|><|start_header_id|>assistant<|end_header_id|>
-
-
- Generated Response:
- {
- "name": "get_big_stocks",
- "arguments": {
- "number": 5,
- "region": "US"
- }
- }<|eot_id|>

—4—
Llama 3 实操技术选型
AI 大模型参数大小的技术选型可以参考如下实践原则:
第一、归纳分类任务,大模型参数推荐 3B;
第二、翻译任务,大模型参数推荐 7B;
第三、意图识别任务,大模型参数推荐 13B;
第四、Function Calling Action 任务,大模型参数推荐 70B。
以上这些推荐都是针对顶尖的通用大模型而言,没有经过 Fine-tuning 等微调,微调后的或者 RAG 后的 大模型 AGI 能力会增强,相应参数会变化。
为了帮助同学们彻底掌握 AI 大模型 Agent 智能体、知识库、向量数据库、 RAG、知识图谱的应用开发、部署、生产化,今天我会开2场直播和同学们深度剖析,请同学们点击以下预约按钮免费预约。
—5—
AI 大模型开发技能直播课程
大模型的技术体系非常复杂,即使有了知识图谱和学习路线后,快速掌握并不容易,我们打造了大模型应用技术的系列直播课程,包括:通用大模型技术架构原理、大模型 Agent 应用开发、企业私有大模型开发、向量数据库、大模型应用治理、大模型应用行业落地案例等6项核心技能,帮助同学们快速掌握 AI 大模型的技能。
本文内容由网友自发贡献,转载请注明出处:https://www.wpsshop.cn/w/神奇cpp/article/detail/735778
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。