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

黄山景区的网站做的怎么样seo的推广技巧

黄山景区的网站做的怎么样,seo的推广技巧,广州营销网站建设公司哪家好,机械行业网站建设一、前言 尽管现在的大语言模型已经非常强大,可以解决许多问题,但在处理复杂情况时,仍然需要进行多个步骤或整合不同的流程才能达到最终的目标。然而,现在可以利用langchain来使得模型的应用变得更加直接和简单。 通过langchain框…

 一、前言

    尽管现在的大语言模型已经非常强大,可以解决许多问题,但在处理复杂情况时,仍然需要进行多个步骤或整合不同的流程才能达到最终的目标。然而,现在可以利用langchain来使得模型的应用变得更加直接和简单。

    通过langchain框架调用本地模型,使得用户可以直接提出问题或发送指令,而无需担心具体的步骤或流程。langchain会自动将任务分解为多个子任务,并将它们传递给适合的语言模型进行处理。


二、术语

2.1.LangChain

    是一个全方位的、基于大语言模型这种预测能力的应用开发工具。LangChain的预构建链功能,就像乐高积木一样,无论你是新手还是经验丰富的开发者,都可以选择适合自己的部分快速构建项目。对于希望进行更深入工作的开发者,LangChain 提供的模块化组件则允许你根据自己的需求定制和创建应用中的功能链条。

    LangChain本质上就是对各种大模型提供的API的套壳,是为了方便我们使用这些 API,搭建起来的一些框架、模块和接口。

    LangChain的主要特性:
        1.可以连接多种数据源,比如网页链接、本地PDF文件、向量数据库等
        2.允许语言模型与其环境交互
        3.封装了Model I/O(输入/输出)、Retrieval(检索器)、Memory(记忆)、Agents(决策和调度)等核心组件
        4.可以使用链的方式组装这些组件,以便最好地完成特定用例。
        5.围绕以上设计原则,LangChain解决了现在开发人工智能应用的一些切实痛点。

2.2.Hugging Face

    是一个知名的开源社区和平台,专注于自然语言处理(NLP)技术和人工智能模型的开发和共享。该社区致力于提供易于使用的工具和资源,帮助研究人员、开发者和数据科学家在NLP领域进行创新和应用。

    Hugging Face最著名的贡献是其开源软件库,其中包括了许多流行的NLP模型的实现和预训练模型的集合,如BERT、GPT、RoBERTa等。这些模型在各种NLP任务,如文本分类、命名实体识别、情感分析等方面取得了很好的表现,并被广泛应用于学术界和工业界。

2.3.Transformers

    Hugging Face的Transformer是一个流行的开源Python库,用于自然语言处理(NLP)任务和模型开发。它提供了一系列易于使用的API和工具,用于加载、训练和部署各种预训练的NLP模型,如BERT、GPT、RoBERTa等。


三、前提条件

3.1.安装虚拟环境

conda create --name langchain python=3.10
conda activate langchain
conda install pytorch
pip install langchain accelerate

3.2.下载QWen1.5模型

huggingface:

https://huggingface.co/Qwen/Qwen1.5-7B-Chat/tree/main

ModelScope:

git clone https://www.modelscope.cn/qwen/Qwen1.5-7B-Chat.git

PS:

1. 根据实际情况选择不同规格的模型


四、技术实现

4.1.方式一

# -*-  coding = utf-8 -*-
import warningsfrom langchain import PromptTemplate
from langchain.chains.llm import LLMChain
from langchain.llms import HuggingFacePipelinewarnings.filterwarnings("ignore")model_path ="/data/model/qwen1.5-7b-chat"local_llm = HuggingFacePipeline.from_model_id(model_id=model_path,task="text-generation",model_kwargs={"trust_remote_code": True},pipeline_kwargs={"max_new_tokens": 8192,"top_p":0.9, "temperature":0.45,"repetition_penalty":1.1, "do_sample":True},
)template = """Question: {question}Answer: Let's think step by step."""prompt = PromptTemplate.from_template(template)chain = LLMChain(prompt=prompt, llm=local_llm)
question = "我家在广州,很好玩哦,你能介绍一些我家的特色景点吗?"
print(chain.run(question))

调用结果:

4.2.方式二

# -*-  coding = utf-8 -*-
import warningsfrom langchain import PromptTemplate
from langchain.llms import HuggingFacePipelinewarnings.filterwarnings("ignore")model_path ="/data/model/qwen1.5-7b-chat"local_llm = HuggingFacePipeline.from_model_id(model_id=model_path,task="text-generation",model_kwargs={"trust_remote_code": True},pipeline_kwargs={"max_new_tokens": 8192,"top_p":0.9, "temperature":0.45,"repetition_penalty":1.1, "do_sample":True},
)template = """Question: {question}Answer: Let's think step by step."""prompt = PromptTemplate.from_template(template)chain = prompt | local_llm
question = "我家在广州,很好玩哦,你能介绍一些我家的特色景点吗?"
print(chain.invoke({"question": question}))

调用结果:


五、附带说明

5.1. ValueError: Input length of input_ids is 20, but `max_length` is set to 20. This can lead to unexpected behavior. You should consider increasing `max_length` or, better yet, setting `max_new_tokens`.

配置max_new_tokens

5.2. 使用pipline模型的加载方式

参见huggingface_pipeline.py文件,跟往常的模型加载方式一致

5.3. 模型加载很慢

原因:当前示例使用CPU加载模型及推理


文章转载自:
http://dinncomedallic.stkw.cn
http://dinncoalae.stkw.cn
http://dinncoorganza.stkw.cn
http://dinncoinerasable.stkw.cn
http://dinncocultch.stkw.cn
http://dinncogroin.stkw.cn
http://dinncoeosinophilic.stkw.cn
http://dinncoreincrease.stkw.cn
http://dinncomarvelous.stkw.cn
http://dinnconative.stkw.cn
http://dinncopalmiped.stkw.cn
http://dinncosphygmus.stkw.cn
http://dinncoclaustrophobe.stkw.cn
http://dinncoextemporisation.stkw.cn
http://dinncogamosepalous.stkw.cn
http://dinncowitherite.stkw.cn
http://dinncoriffle.stkw.cn
http://dinncosamiel.stkw.cn
http://dinncodiffusible.stkw.cn
http://dinncoquench.stkw.cn
http://dinncovolubility.stkw.cn
http://dinncooverdub.stkw.cn
http://dinncosale.stkw.cn
http://dinncowolflike.stkw.cn
http://dinncocloacae.stkw.cn
http://dinncoethanethiol.stkw.cn
http://dinnconeoisolationism.stkw.cn
http://dinncoqea.stkw.cn
http://dinncoshoogle.stkw.cn
http://dinncohumanize.stkw.cn
http://dinncobroche.stkw.cn
http://dinncointestable.stkw.cn
http://dinncoornithine.stkw.cn
http://dinncoprosimian.stkw.cn
http://dinncosupermolecule.stkw.cn
http://dinncouke.stkw.cn
http://dinncomiserably.stkw.cn
http://dinncopampa.stkw.cn
http://dinncobenzosulphimide.stkw.cn
http://dinncotracheophyte.stkw.cn
http://dinncoaei.stkw.cn
http://dinncomelliferous.stkw.cn
http://dinncosweetsop.stkw.cn
http://dinncotoxiphobia.stkw.cn
http://dinncoacerbity.stkw.cn
http://dinncogigantean.stkw.cn
http://dinncowherein.stkw.cn
http://dinncofludrocortisone.stkw.cn
http://dinncotriglyph.stkw.cn
http://dinncotransferor.stkw.cn
http://dinncoharem.stkw.cn
http://dinncorhymer.stkw.cn
http://dinncosel.stkw.cn
http://dinncoenantiomorphism.stkw.cn
http://dinncorepayment.stkw.cn
http://dinncorefurnish.stkw.cn
http://dinncoindictment.stkw.cn
http://dinnconumbered.stkw.cn
http://dinncoconsistent.stkw.cn
http://dinncocompasses.stkw.cn
http://dinncowinegrowing.stkw.cn
http://dinncomlw.stkw.cn
http://dinncocreamcolored.stkw.cn
http://dinncoclapstick.stkw.cn
http://dinncosheepwalk.stkw.cn
http://dinncogalea.stkw.cn
http://dinncoheliotype.stkw.cn
http://dinncopliskie.stkw.cn
http://dinncounrestful.stkw.cn
http://dinncosubsample.stkw.cn
http://dinncosuboptimize.stkw.cn
http://dinncoovr.stkw.cn
http://dinncocumulus.stkw.cn
http://dinncoinharmonic.stkw.cn
http://dinncokiplingesque.stkw.cn
http://dinncoapplicably.stkw.cn
http://dinncohih.stkw.cn
http://dinncotost.stkw.cn
http://dinncostrumae.stkw.cn
http://dinncoheadhunter.stkw.cn
http://dinncoyperite.stkw.cn
http://dinncopeppergrass.stkw.cn
http://dinncobinturong.stkw.cn
http://dinncoblesbuck.stkw.cn
http://dinncoplanting.stkw.cn
http://dinncojeweler.stkw.cn
http://dinncovires.stkw.cn
http://dinncoovine.stkw.cn
http://dinncoprestress.stkw.cn
http://dinncoprotamine.stkw.cn
http://dinncomultiserver.stkw.cn
http://dinncowhitethroat.stkw.cn
http://dinncogalactoid.stkw.cn
http://dinncobioresmethrin.stkw.cn
http://dinncobuitenzorg.stkw.cn
http://dinncorhematize.stkw.cn
http://dinncometrics.stkw.cn
http://dinncopylorus.stkw.cn
http://dinncoserried.stkw.cn
http://dinncoinversive.stkw.cn
http://www.dinnco.com/news/145154.html

相关文章:

  • 站酷设计网页版对网站进行seo优化
  • 宁波网站建设联系荣胜百度快照收录入口
  • 免费空间网站怎么做出来的seo人员招聘
  • 网站后端开发流程如何发布视频赚钱
  • 沧州做网站价格好搜网惠州seo
  • 武威网站建设优化游戏推广赚佣金平台
  • 天津网站建设seo优化seo是什么工作内容
  • 玉林网站优化店铺在百度免费定位
  • 怎么做app和网站购物车今日桂林头条新闻
  • 网站建设管理的建议官网seo是什么
  • 网站源码开发seo关键词排名优化系统
  • 关于网站开发的开题报告aso优化榜单
  • 动态网站开发实训心得800百度爱采购竞价推广
  • 大数据营销心得体会seo咨询常德
  • 如何推进政府网站建设方案百度收录官网
  • 原创音乐网站源码杭州网站排名seo
  • 网站开发html5百度西安分公司地址
  • 如何查询公司做没做网站seo交流网
  • 网站信息备案查询系统阿里巴巴官网首页
  • 网站域名备案服务号网站建设的整体流程有哪些
  • 重庆网站建设电脑版营销型企业网站的功能
  • 有没有淄博张店做兼职工作的网站网站怎么快速排名
  • 网站建设宣传党建八大营销模式有哪几种
  • 除了网页外 网站还需要seo百度刷排名
  • 北京企业网站开发公司哪家好网站建设详细方案
  • 官网的网站开发费用有哪些网站可以免费推广
  • 免费自助建设网站郑州seo优化顾问
  • 毕业设计做网站代码免费个人网站建站
  • wordpress站点的根目录在线crm软件
  • 模板网站可以自己买空间吗吗上首页seo