Transformers.pipelines:从汇总方法中提取 input_length

问题描述

我正在尝试使用 pipline 找到文本摘要的最佳输出 但是,有时我会收到此警告:

Your max_length is set to 100,but you input_length is only 79. You might consider decreasing
max_length manually,e.g. summarizer('...',max_length=50) 

我在文档 (https://huggingface.co/transformers/_modules/transformers/pipelines/text2text_generation.html#SummarizationPipeline) 中看到这是来自该类的 input_legth:

input_length = tf.shape(inputs["input_ids"])[-1].numpy()

有人知道我怎样才能从一开始就得到/知道 input_length 是什么,而我只输入了几个 strstrings 吗?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)