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

帮企业外卖网站做推中国十大软件公司

帮企业外卖网站做推,中国十大软件公司,外贸网站dns,个人网站域名备案流程GPT实战系列-LangChain如何构建基通义千问的多工具链 LLM大模型: GPT实战系列-探究GPT等大模型的文本生成 GPT实战系列-Baichuan2等大模型的计算精度与量化 GPT实战系列-GPT训练的Pretraining,SFT,Reward Modeling,RLHF GPT实…

GPT实战系列-LangChain如何构建基通义千问的多工具链

LLM大模型:

GPT实战系列-探究GPT等大模型的文本生成

GPT实战系列-Baichuan2等大模型的计算精度与量化

GPT实战系列-GPT训练的Pretraining,SFT,Reward Modeling,RLHF

GPT实战系列-ChatGLM3本地部署CUDA11+1080Ti+显卡24G实战方案

GPT实战系列-Baichuan2本地化部署实战方案

GPT实战系列-大话LLM大模型训练

随着OpenAI的GPT-4这样的大型语言模型(LLMs)已经风靡全球,现在让它们自动执行各种任务,如回答问题、翻译语言、分析文本等。LLMs是在交互上真正体验到像“人工智能”。

如何管理这些模块呢?

LangChain在这方面发挥重要作用。LangChain使构建由LLMs驱动的应用程序变得简单,使用LangChain,可以在统一的界面中轻松与不同类型的LLMs进行交互,管理模型版本,管理对话版本,并将LLMs连接在一起。

准备

本例子中,采用通义千问作为LLM

# 引入需要的模块
from langchain.chains import LLMChain, SimpleSequentialChainfrom langchain import PromptTemplateimport os

设置 千问的相关环境,和模型接口函数:

from langchain_community.llms import Tongyi
os.environ["DASHSCOPE_API_KEY"] = "your key"
llm = Tongyi()

构建第一个Prompt链

LangChain可以连接到自己定义的工具,也可以连接到内嵌的tool提供商。此处,先用Prompt构建简单的链路。

# 第一步 prompt工具链
template = "Can you provide a brief summary of the movie {movie_title}? Please keep it concise."first_prompt = PromptTemplate(input_variables=["movie_title"],template=template)chain_one = LLMChain(llm=llm, prompt=first_prompt)

构建第二个Prompt链

# 第二步 prompt工具链second_prompt = PromptTemplate(input_variables=["actor"],template="Can you list three movies featuring {actor}?")chain_two = LLMChain(llm=llm, prompt=second_prompt)

可以看到 两个int 参数:

multiply
multiply(a: int, b: int) -> int - Multiply two numbers.
{'a': {'title': 'A', 'type': 'integer'}, 'b': {'title': 'B', 'type': 'integer'}}

SimpleSequentialChain把链串起来

通过SimpleSequentialChain 把 各个链串起来,形成信息处理流。

# 结合第一和第二链
overall_chain = SimpleSequentialChain(chains=[chain_one, chain_two], verbose=True)final_answer = overall_chain.run("Inception")print(final_answer)

最后打印,实现功能。效果取决于定义的Prompt和模型的能力,得到类似的输出::

> Entering new SimpleSequentialChain chain...
Inception is a 2010 science fiction thriller film directed by Christopher Nolan. The movie follows Dom Cobb (Leonardo DiCaprio), an expert thief who specializes in infiltrating people's dreams to steal their ideas. Cobb is offered a chance to have his criminal history erased if he completes an impossible task: implanting an idea into the subconscious mind of a wealthy businessman, Robert Fischer (Cillian Murphy). To do this, Cobb assembles a team including a chemist, an architect, and a forger, and they delve into multiple layers of dream-sharing, facing challenges like time dilation and the risk of being trapped in their own subconscious. As the dreamscapes become more complex, Cobb's haunted past threatens to derail the mission and jeopardize the lives of his team members. The film explores themes of reality, dreams, and the power of the human mind.
1. The Matrix (1999) - This science fiction action film, directed by the Wachowskis, also blurs the lines between reality and the virtual world. It follows Neo (Keanu Reeves), a computer programmer who discovers that his reality is actually a simulated world created by intelligent machines. With the help of a group of rebels, including Morpheus (Laurence Fishburne) and Trinity (Carrie-Anne Moss), Neo learns to manipulate this simulated reality and fights against the machine-controlled dystopia.2. Interstellar (2014) - Another Christopher Nolan-directed film, Interstellar explores the boundaries of space, time, and human endeavor. Matthew McConaughey plays Cooper, a former pilot and engineer who leads an expedition through a wormhole in search of a new habitable planet for humanity. The movie delves into complex scientific concepts like relativity and the fifth dimension while examining the emotional impact of leaving loved ones behind.3. Paprika (2006) - This Japanese animated psychological science fiction film, directed by Satoshi Kon, revolves around a device that allows therapists to enter and explore their patients' dreams. Dr. Atsuko Chiba, using her alter ego Paprika, must navigate a chaotic dreamscape when the device falls into the wrong hands, causing dream and reality to merge dangerously. The film explores similar themes of dreams and their impact on the human psyche as Inception.> Finished chain.
1. The Matrix (1999) - This science fiction action film, directed by the Wachowskis, also blurs the lines between reality and the virtual world. It follows Neo (Keanu Reeves), a computer programmer who discovers that his reality is actually a simulated world created by intelligent machines. With the help of a group of rebels, including Morpheus (Laurence Fishburne) and Trinity (Carrie-Anne Moss), Neo learns to manipulate this simulated reality and fights against the machine-controlled dystopia.2. Interstellar (2014) - Another Christopher Nolan-directed film, Interstellar explores the boundaries of space, time, and human endeavor. Matthew McConaughey plays Cooper, a former pilot and engineer who leads an expedition through a wormhole in search of a new habitable planet for humanity. The movie delves into complex scientific concepts like relativity and the fifth dimension while examining the emotional impact of leaving loved ones behind.3. Paprika (2006) - This Japanese animated psychological science fiction film, directed by Satoshi Kon, revolves around a device that allows therapists to enter and explore their patients' dreams. Dr. Atsuko Chiba, using her alter ego Paprika, must navigate a chaotic dreamscape when the device falls into the wrong hands, causing dream and reality to merge dangerously. The film explores similar themes of dreams and their impact on the human psyche as Inception.

LangChain是一个Python框架,可以使用LLMs构建应用程序。它与各种模块连接,使与LLM和提示管理,一切变得简单。

觉得有用 收藏 收藏 收藏

点个赞 点个赞 点个赞

End

GPT专栏文章:

GPT实战系列-ChatGLM3本地部署CUDA11+1080Ti+显卡24G实战方案

GPT实战系列-LangChain + ChatGLM3构建天气查询助手

大模型查询工具助手之股票免费查询接口

GPT实战系列-简单聊聊LangChain

GPT实战系列-大模型为我所用之借用ChatGLM3构建查询助手

GPT实战系列-P-Tuning本地化训练ChatGLM2等LLM模型,到底做了什么?(二)

GPT实战系列-P-Tuning本地化训练ChatGLM2等LLM模型,到底做了什么?(一)

GPT实战系列-ChatGLM2模型的微调训练参数解读

GPT实战系列-如何用自己数据微调ChatGLM2模型训练

GPT实战系列-ChatGLM2部署Ubuntu+Cuda11+显存24G实战方案

GPT实战系列-Baichuan2本地化部署实战方案

GPT实战系列-Baichuan2等大模型的计算精度与量化

GPT实战系列-GPT训练的Pretraining,SFT,Reward Modeling,RLHF

GPT实战系列-探究GPT等大模型的文本生成-CSDN博客

http://www.yayakq.cn/news/722583/

相关文章:

  • 建设机械网站案例分析专门做汽车配件的网站
  • 卓商网站建设企业首页模板
  • 济南建网站公司报价全国信息企业公示系统查询
  • 马连洼网站建设长沙网站建设找哪家
  • 做装修行业营销型网站维港豪宅项目网站建设
  • 海淘哪些网站做攻略好制作网站制作网站建设的
  • 网站建设常见问题解决方案比较好的高端网站制作公司
  • 建网站新科网站建设福建坤辕建设工程有限公司网站
  • 正式做网站站点怎么新建百度系app
  • 一个好网站应具备哪些条件茂名建设局网站
  • php语言 网站建设公众平台申请
  • 微信属于营销型网站seo入门讲解
  • 计算机网站开发工作证百度推广下载安装
  • 做外贸有哪些网站如何更换网站新域名
  • 网站功能的介绍qt做网站服务器
  • 网站建设服务器在国外如何打击博客 软件 wordpress
  • 国企集团门户网站建设方案直接拖拉做网站的软件
  • 自助建设外贸网站为什么做网站特效用用插件
  • 建设部资质网站网上怎么找人去推广广告
  • 精品课程网站开发的开题报告公司网站建设价格标准
  • 网站开发技术课程设计说明书网页设计制作网站模板
  • 下载宝硬盘做网站网站推广服务器怎么选
  • 手机评测哪个网站做的好点做网站底色怎么选
  • 绵阳营销型网站建设金融行业网站模板
  • xuzhou网站制作网站建设设计公司 知乎
  • 一个网站做数据维护3天正常吗企业网站设计开题报告
  • 重庆企业网站推广方法聚美优品的电子商务网站建设论文
  • 产品网站更新内容二手购物网站建设方案
  • 查询网站名有没有收录站网站推广
  • 网站推广有哪些方法wordpress加百度广告代码出问题