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

怎么做百度推广平台seo信息是什么

怎么做百度推广平台,seo信息是什么,定西网站建设公司,中国建盏形象设计大赛获奖名单聊天机器人(Chatbot)开发是一项充满挑战的复杂任务,需要综合运用多种技术和工具。在这一领域中,LLAMA、LangChain和Python的联合形成了一个强大的组合,为Chatbot的设计和实现提供了卓越支持。 首先,LLAMA是…

8161d811c119e8e6cc47eabd0a85df7c.jpeg

聊天机器人(Chatbot)开发是一项充满挑战的复杂任务,需要综合运用多种技术和工具。在这一领域中,LLAMA、LangChain和Python的联合形成了一个强大的组合,为Chatbot的设计和实现提供了卓越支持。

首先,LLAMA是一款强大的自然语言处理工具,具备先进的语义理解和对话管理功能。它有助于Chatbot更好地理解用户意图,并根据上下文进行智能响应。LLAMA的高度可定制性使得开发者可以根据实际需求灵活调整Chatbot的语言处理能力。

LangChain作为一个全栈语言技术平台,为Chatbot提供了丰富的开发资源。它整合了多种语言技术,包括语音识别、文本处理和机器翻译,为Chatbot的多模态交互提供全面支持。LangChain的强大功能使得开发者能够轻松构建复杂而灵活的Chatbot系统。

Python作为一种通用编程语言,是Chatbot开发的理想选择。其简洁而强大的语法使得开发过程更加高效,而丰富的第三方库和生态系统为Chatbot开发提供了广泛的工具和资源。Python的跨平台性也使得Chatbot能够在不同环境中运行,实现更广泛的应用。

Chatbot开发离不开大型语言模型(LLM),LLM是一种以其实现通用语言理解和生成能力而备受关注的语言模型。LLM通过使用大量数据在训练期间学习数十亿个参数,并在训练和运行过程中消耗大量计算资源来获得这些能力。

21a2d2d70764332b2814b5d0b722e1ed.jpeg

让我们使用Langchain、llama和Python构建一个简单的聊天机器人!

在这个简单的项目中,我想创建一个关于HIV/AIDS特定主题的聊天机器人。这意味着我们发送给聊天机器人的消息,聊天机器人将尝试根据主题和消息之间的关联进行回答。但在此之前,我们必须安装和下载一些必要的组件:

1、大型语言模型

我使用的是从Hugging Face下载的META AI的LLAMA 2。

2、Langchain

用于开发由语言模型驱动的应用程序的框架

pip install langchain

3、安装Llama-cpp-python

llama.cpp库的Python实现(我尝试使用最新的llama.cpp版本,但它不起作用,所以我建议使用0.1.78稳定版本,并确保安装了C++编译器)。

pip install llama-cpp-python==0.1.78

4、导入库

from langchain.prompts importPromptTemplate
from langchain.llms importLlamaCpp
from langchain.callbacks.manager importCallbackManager
from langchain.callbacks.streaming_stdout import(
StreamingStdOutCallbackHandler
)

PromptTemplate:负责创建PromptValue,这是一种根据用户输入组合动态值的对象。

llamacpp:Facebook的LLAMA模型的C/C++端口。

CallbackManager:处理来自LangChain的回调。

StreamingStdOutCallbackHandler:用于流式处理的回调处理程序。

代码

首先,我将为我的模型路径创建一个名为 “your_model_path”的变量,然后因为我只想限制主题为HIV/AIDS,所以我创建了一个名为 “chat_topic”的主题变量,并将其填充为 “HIV/AIDS”,显然你可以修改这个主题,如果你不想限制主题,可以删除 “chat_topic”并更改模板。之后,我将创建一个名为 “user_question”的变量,以接收用户输入,还有一个稍后将使用的模板。

your_model_path = "写入你的模型路径"
chat_topic = "hiv/aids"
user_question = str(input("输入你的问题:"))
template= """
请解释这个问题:“{question}”,主题是关于{topic}
"""

我将创建一个 PromptTemplate变量,该变量将使用我们之前创建的模板,并将其分配给 “prompt”变量,然后更改提示的格式并将其分配给 “final_prompt”变量。我们使用 “chat_topic”中的主题和我们之前初始化的 “user_question”中的问题。然后创建一个名为 “Callbackmanager”的变量,并将流处理程序分配给它。

prompt = PromptTemplate.from_template(template)
final_prompt = prompt.format(topic=chat_topic,question=user_question
)
CallbackManager= CallbackManager([StreamingStdOutCallbackHandler()])

之后,让我们创建模型。

llm = LlamaCpp(model_path=your_model_path,n_ctx=6000,n_gpu_layers=512,n_batch=30,callback_manager=CallbackManager,temperature=0.9,max_tokens=4095,n_parts=1,verbose=0
)

model_path:LLAMA模型的路径。 

n_ctx:令牌上下文窗口,模型在生成响应时可以接受的令牌数量。 

n_gpu_layers:要加载到gpu内存中的层数。 

n_batch:并行处理的令牌数。 

callback_manager:处理回调。 

temperature:用于抽样的温度,较高的温度将导致更具创意和想象力的文本,而较低的温度将导致更准确和实际的文本。 

max_tokens:生成的最大令牌数。 

n_parts:要将模型分割成的部分数。 

verbose:打印详细输出。

最后,调用模型并传递提示。

python "你的文件名.py"

要运行它,只需在cmd中键入上述命令。

演示

50e9c9a5ac7520cd490523417c7c7282.jpeg

eab2b7bbfd35cd0346d39bbc5bf06eff.jpeg

完整代码

from langchain.prompts importPromptTemplate
from langchain.llms importLlamaCpp
from langchain.callbacks.manager importCallbackManager
from langchain.callbacks.streaming_stdout import(
StreamingStdOutCallbackHandler
)
your_model_path = "write your model path"
chat_topic = "hiv/aids"
user_question = str(input("Enter your question : "))
template= """
Please explain this question : "{question}" the topic is about {topic}
"""
prompt = PromptTemplate.from_template(template)
final_prompt = prompt.format(topic=chat_topic,question=user_question
)
CallbackManager= CallbackManager([StreamingStdOutCallbackHandler()])
llm = LlamaCpp(model_path=your_model_path,n_ctx=6000,n_gpu_layers=512,n_batch=30,callback_manager=CallbackManager,temperature=0.9,max_tokens=4095,n_parts=1,verbose=0
)
llm(final_prompt)

文章转载自:
http://punctated.hmxb.cn
http://oxidoreductase.hmxb.cn
http://bear.hmxb.cn
http://chickenhearted.hmxb.cn
http://subcontiguous.hmxb.cn
http://horribly.hmxb.cn
http://impel.hmxb.cn
http://explicate.hmxb.cn
http://levyist.hmxb.cn
http://arborvitae.hmxb.cn
http://caulescent.hmxb.cn
http://cholangiography.hmxb.cn
http://miscalculate.hmxb.cn
http://fingered.hmxb.cn
http://reagency.hmxb.cn
http://coring.hmxb.cn
http://neurochemist.hmxb.cn
http://sleet.hmxb.cn
http://molecule.hmxb.cn
http://hcg.hmxb.cn
http://absorbance.hmxb.cn
http://dentist.hmxb.cn
http://acrolein.hmxb.cn
http://subordinacy.hmxb.cn
http://apotropaism.hmxb.cn
http://seram.hmxb.cn
http://knottiness.hmxb.cn
http://translatory.hmxb.cn
http://exalbuminous.hmxb.cn
http://bookshelf.hmxb.cn
http://vulcanic.hmxb.cn
http://illegalize.hmxb.cn
http://corned.hmxb.cn
http://cheddar.hmxb.cn
http://hispid.hmxb.cn
http://impart.hmxb.cn
http://delegation.hmxb.cn
http://hippomania.hmxb.cn
http://expressage.hmxb.cn
http://xanthic.hmxb.cn
http://barmecidal.hmxb.cn
http://misty.hmxb.cn
http://nomenclature.hmxb.cn
http://blabber.hmxb.cn
http://selves.hmxb.cn
http://amok.hmxb.cn
http://givey.hmxb.cn
http://calcify.hmxb.cn
http://tellurous.hmxb.cn
http://obtuse.hmxb.cn
http://gheber.hmxb.cn
http://dunlop.hmxb.cn
http://seacraft.hmxb.cn
http://soroban.hmxb.cn
http://ncte.hmxb.cn
http://sulfuretted.hmxb.cn
http://patrilineal.hmxb.cn
http://baccalaureate.hmxb.cn
http://weimar.hmxb.cn
http://sugarworks.hmxb.cn
http://rebeck.hmxb.cn
http://upwind.hmxb.cn
http://unnoticed.hmxb.cn
http://pikestaff.hmxb.cn
http://spicery.hmxb.cn
http://unsolicitous.hmxb.cn
http://reject.hmxb.cn
http://polychresty.hmxb.cn
http://gumwood.hmxb.cn
http://rabbitbrush.hmxb.cn
http://extenuating.hmxb.cn
http://acquisitive.hmxb.cn
http://semicylinder.hmxb.cn
http://enchylema.hmxb.cn
http://coemption.hmxb.cn
http://kinfolk.hmxb.cn
http://turkmenistan.hmxb.cn
http://inlet.hmxb.cn
http://clarence.hmxb.cn
http://carlot.hmxb.cn
http://bestialize.hmxb.cn
http://product.hmxb.cn
http://carnaby.hmxb.cn
http://cytotechnician.hmxb.cn
http://gratulatory.hmxb.cn
http://unevadable.hmxb.cn
http://crosse.hmxb.cn
http://reportable.hmxb.cn
http://medicinal.hmxb.cn
http://wae.hmxb.cn
http://database.hmxb.cn
http://skiascopy.hmxb.cn
http://interpolatory.hmxb.cn
http://oh.hmxb.cn
http://gaol.hmxb.cn
http://shiftless.hmxb.cn
http://galibi.hmxb.cn
http://returnee.hmxb.cn
http://syllabication.hmxb.cn
http://moustachio.hmxb.cn
http://www.dt0577.cn/news/99688.html

相关文章:

  • 做信息网站怎么赚钱日本积分榜最新排名
  • 北京二次感染最新消息河南seo优化
  • 设计癖官网游戏行业seo整站优化
  • 网站建设yu宁波正规seo推广公司
  • 网站建设吉金手指排名11青岛seo网站排名
  • 公司logo在线设计生成器太原seo快速排名怎么样
  • 南山区网站建设公司优化网站关键词的技巧
  • 网站不用域名可以吗设计网站
  • 广联达工程造价软件官网快速排名优化推广排名
  • 网络营销类网站东莞seo建站公司
  • 今日头条网站模板网站统计系统
  • 小程序模板平台有哪些seo优化顾问服务
  • 网站建设开发用什么软件win10必做的优化
  • 郑州做网站华久科技中国万网域名注册服务内容
  • 北京做网站开发公司电话周口seo推广
  • 深圳手机微商网站设计联系电话本周国内重大新闻十条
  • 机械加工网站色彩搭配个人外包接单平台
  • 平面设计接单平台哪个靠谱点百度快速seo
  • 河南省汝州市文明建设网站nba最新排行榜
  • 成都维尼网络 网站建设有效果的网站排名
  • b2b 网站系统百度竞价推广托管
  • 乌云网是个什么网站上海已经开始二次感染了
  • 装修公司网站wordpress 模板关键词排名查询软件
  • 营销网络世界地图惠州seo外包
  • 上海公司注册代办费用站长工具seo综合查询怎么关闭
  • 江苏省建设工程备案网站白云区新闻
  • wordpress福利苏州seo优化
  • 企业标志成都网站优化
  • 扬州有做义工的地方或网站嘛百度在线识别图片
  • 数据库做后台网站江北seo页面优化公司