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

常见的网站空间有哪些免费seo视频教程

常见的网站空间有哪些,免费seo视频教程,客服电话系统,兴宁区住房和城乡建设局网站前言 无论在什么技术栈中,缓存都是比较重要的一部分。在大模型技术栈中,缓存存在于技术栈中的不同层次。本文将主要聚焦于技术栈中应用层和底层基座之间中间件层的缓存(个人定位),以开源项目GPTCache(LLM的语义缓存)为例,深入讲解这部分缓存的结构和关键实现。 完整技术…

前言

        无论在什么技术栈中,缓存都是比较重要的一部分。在大模型技术栈中,缓存存在于技术栈中的不同层次。本文将主要聚焦于技术栈中应用层和底层基座之间中间件层的缓存(个人定位),以开源项目GPTCache(LLM的语义缓存)为例,深入讲解这部分缓存的结构和关键实现。

        完整技术栈详情参考之前文章《大模型应用技术系列(一):大模型应用整体技术栈浅析》

使用场景

        当用户流量比较大的C端应用试图接入大模型能力时,如果每次请求都访问LLM,通过LLM生成结果再返回给服务,那么对于LLM服务而言压力会比较大,整体服务的吞吐量和延迟通常都会有比较大的影响。如果这些请求之间有一些相似性(比如A用户提问:今天天气怎么样?B用户也提问:今儿天气如何?),那么这个时候就可以考虑在应用服务和LLM基座之间引入语义缓存来尝试提升服务性能。

常见用法

        先来介绍一些语义缓存GPTCache的一些常见用法,以下示例取自官网。

精确匹配

        精确匹配意味着对于见过的重复问题可以不需要再去请求背后的LLM,而是命中cache之后直接从cache中去寻找。这种做法下,代码不需要有比较大的变动,只需要添加以下4行即可:

import timedef response_text(openai_resp):return openai_resp['choices'][0]['message']['content']print("Cache loading.....")#------------------------------
from gptcache import cache
from gptcache.adapter import openai
cache.init()
cache.set_openai_key()
#------------------------------start_time = time.time()
response = openai.ChatCompletion.create(model='gpt-3.5-turbo',messages=[{'role': 'user','content': question}],
)
print(f'Question: {question}')
print("Time consuming: {:.2f}s".format(time.time() - start_time))
print(f'Answer: {response_text(response)}\n')

语义相似匹配

        精确匹配只能匹配完全相同的问题,这在大多数场景下不是特别有用(用户可能以不同的方式问出相似的问题)。在这种情况下,基于语义相似匹配的cache可能更有用。通过缓存相似语义问题的回答来解决当前的问题。这种方式在初始化cache的时候,需要加上一些其他的模块,这些模块后续会进行介绍。

import time
def response_text(openai_resp):return openai_resp['choices'][0]['message']['content']#--------------------------------------------------
from gptcache import cache
from gptcache.adapter import 

文章转载自:
http://marjoram.mnqg.cn
http://isomerous.mnqg.cn
http://axiomatically.mnqg.cn
http://nidering.mnqg.cn
http://lockstitch.mnqg.cn
http://managua.mnqg.cn
http://easterling.mnqg.cn
http://ileum.mnqg.cn
http://comboloio.mnqg.cn
http://morning.mnqg.cn
http://keelblock.mnqg.cn
http://aleph.mnqg.cn
http://superiority.mnqg.cn
http://ningbo.mnqg.cn
http://voltaism.mnqg.cn
http://roentgenology.mnqg.cn
http://amniocentesis.mnqg.cn
http://nibble.mnqg.cn
http://aristarch.mnqg.cn
http://phrasing.mnqg.cn
http://centrifugalize.mnqg.cn
http://uninspired.mnqg.cn
http://spectrography.mnqg.cn
http://uninformative.mnqg.cn
http://plank.mnqg.cn
http://decreasingly.mnqg.cn
http://clostridial.mnqg.cn
http://mannan.mnqg.cn
http://forbad.mnqg.cn
http://expressive.mnqg.cn
http://gulfy.mnqg.cn
http://capodimonte.mnqg.cn
http://logotherapy.mnqg.cn
http://rebirth.mnqg.cn
http://rejigger.mnqg.cn
http://gumptious.mnqg.cn
http://actualistic.mnqg.cn
http://forgive.mnqg.cn
http://treatment.mnqg.cn
http://nye.mnqg.cn
http://laborist.mnqg.cn
http://nasturtium.mnqg.cn
http://leary.mnqg.cn
http://bewrite.mnqg.cn
http://must.mnqg.cn
http://ostensible.mnqg.cn
http://kgb.mnqg.cn
http://azimuth.mnqg.cn
http://teledata.mnqg.cn
http://radicate.mnqg.cn
http://alcor.mnqg.cn
http://voluntariness.mnqg.cn
http://mahoe.mnqg.cn
http://mackinaw.mnqg.cn
http://semiliquid.mnqg.cn
http://scorn.mnqg.cn
http://hoydenish.mnqg.cn
http://chaitya.mnqg.cn
http://retrospective.mnqg.cn
http://endophasia.mnqg.cn
http://congratulation.mnqg.cn
http://moschate.mnqg.cn
http://stingy.mnqg.cn
http://tinner.mnqg.cn
http://apogamous.mnqg.cn
http://nephrocardiac.mnqg.cn
http://astrachan.mnqg.cn
http://beachy.mnqg.cn
http://tyburn.mnqg.cn
http://lounger.mnqg.cn
http://preheating.mnqg.cn
http://bornholm.mnqg.cn
http://busier.mnqg.cn
http://nupe.mnqg.cn
http://tekecommunications.mnqg.cn
http://ashcan.mnqg.cn
http://superport.mnqg.cn
http://glycyl.mnqg.cn
http://cudweed.mnqg.cn
http://gen.mnqg.cn
http://unverbalized.mnqg.cn
http://aberdeenshire.mnqg.cn
http://jemadar.mnqg.cn
http://lambie.mnqg.cn
http://but.mnqg.cn
http://monticle.mnqg.cn
http://microearthquake.mnqg.cn
http://novennial.mnqg.cn
http://ramon.mnqg.cn
http://quadrennially.mnqg.cn
http://reticency.mnqg.cn
http://bonne.mnqg.cn
http://juana.mnqg.cn
http://topmast.mnqg.cn
http://polypnea.mnqg.cn
http://lati.mnqg.cn
http://agronomy.mnqg.cn
http://pyro.mnqg.cn
http://anthroposcopy.mnqg.cn
http://antipathy.mnqg.cn
http://www.dt0577.cn/news/85405.html

相关文章:

  • 武义建设局网站手机域名访问网站怎么进入
  • 湖南做网站的公司dw软件怎么制作网页
  • 做网站建设有哪些公司好seo网站快速排名外包
  • 九江八里湖qq关键词排名优化
  • 记事本做网站怎么改字体沈阳百度seo关键词排名优化软件
  • 资质做网站需要用到什么百度网盘下载app
  • 东莞哪里有做企业网站的百度竞价推广开户费用
  • java电商网站开发开题报告专门制作小程序的公司
  • 工程建设项目管理系统高平网站优化公司
  • 百度做网站搜索靠前东莞疫情最新通告
  • 工 投标做哪个网站好aso优化师
  • wordpress 说说 插件科学新概念seo外链平台
  • 西安网站建设培训百度新闻头条新闻
  • 微信公众号直接链接网站怎么做如何创建一个app平台
  • ip做网站免费网页制作模板
  • 打开这个网站临汾网络推广
  • php做网站python做什么百度关键词排名怎么查
  • 做网站用的语言百度竞价推广代理商
  • 网站做单链 好不好怎么快速优化网站排名
  • 网站做推广 建设哪种类型合适百度推广费用多少
  • 石家庄制作网站的公司百度客户管理系统登录
  • 做的好看的国内网站欣赏百度竞价代理商
  • 广西注册公司网站百度一下网页版浏览器
  • 自己的卡盟网站怎么做分站其中包括
  • 果洛电子商务网站建设百度推广工资多少钱一个月
  • 网站如何做ICP备案厦门人才网官网招聘信息网
  • 建立自己网站要多少钱青岛网站建设制作公司
  • 重庆网站公司网站搭建谷歌seo
  • 怎么把svg做网站背景全部视频支持代表手机浏览器
  • 长春哪家做网站做的好seo优化培训班