logo
publist
写文章

简介

该用户还未填写简介

擅长的技术栈

可提供的服务

暂无可提供的服务

transformers.generator_utils函数源码解析之RepetitionPenaltyLogitsProcessor

主要记录源码中解决文本生成中词组重复出现的问题,代码中有具体操作解析。class RepetitionPenaltyLogitsProcessor(LogitsProcessor):r""":class:`transformers.LogitsProcessor` enforcing an exponential penalty on repeated sequences.Args:repetit

#python#自然语言处理#机器翻译
transformers.generator_utils函数源码解析之beam_search

#beam_search主体函数while True:model_inputs = self.prepare_inputs_for_generation(input_ids, **model_kwargs) #整理下一步decoder所需数据outputs = self(**model_inputs,return_dict=True,output_attentions=output_attenti

#python#ide
运行脚本出现ValueError: bad marshal data (unknown type code)错误

在docker环境中运行程序,报错ValueError: bad marshal data (unknown type code),主要原因在于程序中存在.pyc的缓存文件,只要删除这些文件即可。采用命令:find ./ --name=*.pyc | xargs rm

#python#docker
vLLM: Easy, Fast, and Memory-Efficient LLM Serving with PagedAttention

Prompt阶段:通过用户输入的prompt计算第一个生成token的条件概率,即生成第一个 token。生成过程中得到 prompt token 的 KVCache,用于后续 token 的生成。Decode阶段:逐步迭代生成每个 token,在生成第t+1个token时,需要将prompt token、已生成的 token 及当前第t个token 的 KVCache拼接起来,与第t个token

文章图片
#人工智能#python
‘DistributedDataParallel‘ object has no attribute ‘generate‘(gpu分布式训练提示找不到model中的函数)

在使用DistributedDataParallel训练model的时候,发现在进行forward的过程中,会碰到DistributedDataParallel' object has no attribute的问题。观察可以看到此时的model已经被封装进类似DistributedDataParallel的类里,此model非平常使用的model,所以导致调用原始model的函数时会出现obje

#深度学习
[MOVE]-音频翻唱检索论文笔记

研究Music Information Retrieval (MIR)方向中的Cover song identification任务,减少人工特征和对齐算法的使用,本文提出MOVE网络来检索相同的音乐。

#深度学习#人工智能
文本生成各评价指标详解

文章目录前言基于词重叠率的方法机器翻译 & 摘要 常用指标BLEUROUGENISTMETEORTERdata to text 常用指标relation generation (RG)content selection (CS)content ordering (CO)如何实现上述的评价指标CoverageDistinctimage caption 常用指标CIDEr好处SPIC

#python#自然语言处理#机器翻译
‘DistributedDataParallel‘ object has no attribute ‘generate‘(gpu分布式训练提示找不到model中的函数)

在使用DistributedDataParallel训练model的时候,发现在进行forward的过程中,会碰到DistributedDataParallel' object has no attribute的问题。观察可以看到此时的model已经被封装进类似DistributedDataParallel的类里,此model非平常使用的model,所以导致调用原始model的函数时会出现obje

#深度学习
[BLIP]-多模态Language-Image预训练模型

学习MoCo思想,引入momentum encoder和Queue扩大对比学习的batch大小,base encoder用于梯度更新产生新的embedding,momentum encoder根据以下公式更新,k表示momentum encoder参数,q表示base encoder参数,主要为了提升embedding的一致性,维持队列大小,将最新的embedding入队列,弹出队列头embedd

#深度学习#人工智能#计算机视觉
python h5py详解

1. h5py 文件介绍一个h5py文件是 “dataset” 和 “group” 二合一的容器。1. dataset : 类似数组组织的数据的集合,像 numpy 数组一样工作2. group : 包含了其它 dataset 和 其它 group ,像字典一样工作看下图:通过上图,我们可以知道 h5py 文件就像是文件夹一样,里面很放文件还有文件夹,主文件夹以 ‘/’ 开始,这又像Linux的树

    共 13 条
  • 1
  • 2
  • 请选择