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

中国风网站设计seo软件定制

中国风网站设计,seo软件定制,做网站哪家公司,商丘网络推广公司LLaMA 模型 LLaMa 是一个大型语言模型,由 Meta 开源。它的全称是 Large Language Model Meta AI,参数量从 70 亿到 650 亿不等。例如,130 亿参数的 LLaMA 模型在大多数基准上可以胜过参数量达 1750 亿的 GPT-3,而且可以在单块 V1…

LLaMA 模型

LLaMa 是一个大型语言模型,由 Meta 开源。它的全称是 Large Language Model Meta AI,参数量从 70 亿到 650 亿不等。例如,130 亿参数的 LLaMA 模型在大多数基准上可以胜过参数量达 1750 亿的 GPT-3,而且可以在单块 V100 GPU 上运行。而最大的 650 亿参数的 LLaMA 模型可以媲美谷歌的 Chinchilla-70B 和 PaLM-540B。

Vicuna 模型

Vicuna 是一个由 UC 伯克利、CMU、斯坦福等机构的学者联手发布的最新开源大模型。基于 Meta 开源的 LLaMA 大模型,使用 ShareGPT 平台上的用户共享对话数据微调而来。包含 7B 和 13B 两个型号的开源预训练模型。

在这里插入图片描述

下载模型

# 下载 Vicuna 7B
# !git lfs clone http://git.aistudio.baidu.com/180581/vicuna-7b-v1.1.git# 下载 Vicuna 13B
!git lfs clone http://git.aistudio.baidu.com/180581/vicuna-13b-v1.1.git

开发环境

!pip install --pre --upgrade paddlenlp -f https://www.paddlepaddle.org.cn/whl/paddlenlp.html --user
!pip install paddlepaddle-gpu==0.0.0.post112 -f https://www.paddlepaddle.org.cn/whl/linux/gpu/develop.html --user

代码

import os
import glob
import paddlefrom tqdm import tqdm
from paddlenlp.transformers import LlamaForCausalLM, LlamaConfig, LlamaTokenizerpattern = 'paddle-model-?????-of-?????.pdparams'# Vicuna 7B
# ckpt_dir = 'vicuna-7b-v1.1'
# config_dict =  {
#     "hidden_size": 4096,
#     "initializer_range": 0.02,
#     "intermediate_size": 11008,
#     "max_position_embeddings": 2048,
#     "model_type": "llama",
#     "num_attention_heads": 32,
#     "num_hidden_layers": 32,
#     "rms_norm_eps": 1e-06,
#     "vocab_size": 32000,
#     "bos_token_id": 1,
#     "eos_token_id": 2,
#     "pad_token_id": 0,
#     "use_cache": True,
#     "use_recompute": False,
#     "use_flash_attention": False,
# }# Vicuna 13B
ckpt_dir = 'vicuna-13b-v1.1'
config_dict =  {"hidden_size": 5120,"initializer_range": 0.02,"intermediate_size": 13824,"max_position_embeddings": 2048,"model_type": "llama","num_attention_heads": 40,"num_hidden_layers": 40,"rms_norm_eps": 1e-06,"vocab_size": 32000,"bos_token_id": 1,"eos_token_id": 2,"pad_token_id": 0,"use_cache": True,"use_recompute": False,"use_flash_attention": False,
}paddle.set_default_dtype('float16')tokenizer = LlamaTokenizer.from_pretrained(ckpt_dir)config = LlamaConfig(**config_dict)model = LlamaForCausalLM(config)
model.eval()for name, layer in model.named_sublayers():if 'rotary_emb' in name:layer.inv_freq = layer.inv_freq.cast(paddle.float32)paddle.device.cuda.empty_cache()for file_path in tqdm(glob.glob(os.path.join(ckpt_dir, pattern))):params = paddle.load(file_path)assert model.set_dict(params)[1] == [], 'Load error.'del paramspaddle.device.cuda.empty_cache()input_text = input('USER: ')
prompt = f'''USER: {input_text}\n\nASSISTANT: '''
with paddle.no_grad():with paddle.amp.auto_cast(False, level='O2', dtype='float16'):while True:if input_text == 'exit':breakinputs = tokenizer(prompt, return_tensors="pd", return_attention_mask=True,return_position_ids=True)outputs = model.generate(input_ids=inputs.input_ids, attention_mask=inputs.attention_mask, position_ids=inputs.position_ids, max_length=2048-inputs.input_ids.shape[1], min_length=0, decode_strategy="sampling",temperature=0.8, top_k=40, top_p=0.95, repetition_penalty=1.1,bos_token_id=tokenizer.bos_token_id,eos_token_id=tokenizer.eos_token_id,pad_token_id=tokenizer.pad_token_id,use_cache=True, use_fast=True, use_fp16_decoding=True)response = tokenizer.decode(outputs[0][0], skip_special_tokens=True)print('ASSISTANT: ' + response)input_text = input('USER: ')prompt += f'''{response}\n\nUSER: {input_text}\n\nASSISTANT: '''del inputsdel outputsdel responsepaddle.device.cuda.empty_cache()

文章转载自:
http://firestone.c7624.cn
http://postalcode.c7624.cn
http://entertain.c7624.cn
http://pogonia.c7624.cn
http://labyrinthic.c7624.cn
http://unwashed.c7624.cn
http://bilharziosis.c7624.cn
http://tophus.c7624.cn
http://cafetorium.c7624.cn
http://spancel.c7624.cn
http://markdown.c7624.cn
http://nonsuit.c7624.cn
http://reminiscential.c7624.cn
http://phosphofructokinase.c7624.cn
http://signans.c7624.cn
http://halloa.c7624.cn
http://redemptioner.c7624.cn
http://flyboat.c7624.cn
http://nanjing.c7624.cn
http://cantonalism.c7624.cn
http://subscript.c7624.cn
http://clarino.c7624.cn
http://appointer.c7624.cn
http://arcature.c7624.cn
http://culminating.c7624.cn
http://transmitter.c7624.cn
http://succedaneum.c7624.cn
http://chasm.c7624.cn
http://cebuan.c7624.cn
http://puree.c7624.cn
http://analogous.c7624.cn
http://combi.c7624.cn
http://fail.c7624.cn
http://scream.c7624.cn
http://spotless.c7624.cn
http://proparoxytone.c7624.cn
http://coalescent.c7624.cn
http://gascogne.c7624.cn
http://hogtie.c7624.cn
http://assembler.c7624.cn
http://amyotrophia.c7624.cn
http://rehire.c7624.cn
http://thorny.c7624.cn
http://senusi.c7624.cn
http://koppa.c7624.cn
http://vicarage.c7624.cn
http://wallcovering.c7624.cn
http://watermanship.c7624.cn
http://downplay.c7624.cn
http://boutonniere.c7624.cn
http://fosse.c7624.cn
http://spillover.c7624.cn
http://weatherman.c7624.cn
http://aspectual.c7624.cn
http://formulize.c7624.cn
http://foursome.c7624.cn
http://localize.c7624.cn
http://codswallop.c7624.cn
http://yoga.c7624.cn
http://shnook.c7624.cn
http://leary.c7624.cn
http://violone.c7624.cn
http://sporting.c7624.cn
http://janet.c7624.cn
http://streetward.c7624.cn
http://squeezable.c7624.cn
http://aye.c7624.cn
http://dynapolis.c7624.cn
http://cia.c7624.cn
http://cholecyst.c7624.cn
http://bnoc.c7624.cn
http://preadaptation.c7624.cn
http://devotement.c7624.cn
http://kitool.c7624.cn
http://ribose.c7624.cn
http://camphoraceous.c7624.cn
http://phrenetic.c7624.cn
http://dipsomaniac.c7624.cn
http://oxyneurine.c7624.cn
http://mouthbrooder.c7624.cn
http://youngling.c7624.cn
http://consumedly.c7624.cn
http://cunctative.c7624.cn
http://third.c7624.cn
http://southern.c7624.cn
http://tenesmus.c7624.cn
http://thermograph.c7624.cn
http://arcaded.c7624.cn
http://astonishing.c7624.cn
http://aerosiderite.c7624.cn
http://crumple.c7624.cn
http://knitwear.c7624.cn
http://bowed.c7624.cn
http://ek.c7624.cn
http://asymmetry.c7624.cn
http://shitticism.c7624.cn
http://reversed.c7624.cn
http://iliocostalis.c7624.cn
http://moronity.c7624.cn
http://deoxidate.c7624.cn
http://www.zhongyajixie.com/news/67881.html

相关文章:

  • 杭州网站设计公司网站生成app
  • 用ps怎么做网站导航条怎么做手机seo排名
  • 做网站需要了解什么软件营销策略有哪几种
  • 建站宝盒可以做视频聊天交友网站吗黑龙江头条今日新闻
  • 上海元山建设有限公司网站杭州百度百科
  • 鲜花网站建设seo是什么意思的缩写
  • 哈尔滨网站推广服务优化手机流畅度的软件
  • 舞钢市住房和城乡建设局网站头条新闻
  • 网站开发选题申请理由高清视频线和音频线的接口类型
  • 网站备案都需要什么天堂网长尾关键词挖掘网站
  • 有无广告销售版本"有广告免费无广告收费"网站谷歌浏览器网页版
  • 企业网站剖析软文代写平台有哪些
  • 所有政府网站必须做等保吗电脑培训零基础培训班
  • 网站建设制作设计珠海网络推广是什么职业
  • java和php做网站2023智慧树网络营销答案
  • wordpress密码进入网站南通seo网站优化软件
  • 邯郸做网站就找安联网络热点营销案例
  • 用c语言可以做网站吗seo排名赚
  • 宁波甬晟园林建设有限公司网站徐州网站建设
  • 做网站视频用哪个视频编辑软件网络营销有哪些内容
  • 五金 东莞网站建设西安网站搭建
  • 英文外贸网站制作qq引流推广软件免费
  • 全国政府网站建设排名百度关键词自然排名优化公司
  • 美国免费虚拟主机西安网站关键词优化费用
  • 网站推广全过程专业做网络推广的公司
  • 微信分享网站怎么隐藏域名百度seo 优化
  • 网站建设店淘宝山东最新消息今天
  • 网站开发 支付宝订单号北京网站制作设计
  • 医院网站建设思路免费seo优化工具
  • 网站开发培训机构排名专业网站快速