warning information
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 20/100
- Issue 类型
- 缺陷
- 描述清晰度
- 需要澄清
- 活跃度
- 停滞
- 技术栈
- python
调研方向
No repository file or test is identified. Start by reproducing the supplied Python example with Salesforce/codegen-350M-mono, then inspect the model generation entry point and determine what behavior should be covered when the attention mask and pad token ID are omitted; done requires a documented or tested resolution.
由索引模型根据 Issue 内容生成。
描述
CodeGen is a powerful model.
When I use the model as the following code:
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("Salesforce/codegen-350M-mono")
model = AutoModelForCausalLM.from_pretrained("Salesforce/codegen-350M-mono")
text = "def hello_world():"
input_ids = tokenizer(text, return_tensors="pt").input_ids
generated_ids = model.generate(input_ids, max_length=128)
print(tokenizer.decode(generated_ids[0], skip_special_tokens=True))
However, here has some warning information:
The attention mask and the pad token id were not set. As a consequence, you may observe unexpected behavior. Please pass your input's `attention_mask` to obtain reliable results.
Setting `pad_token_id` to `eos_token_id`:50256 for open-end generation.
Do you know how I can fix it? Plus, what happens if I don't fix it?
Thank you very much!
- 主要语言
- Python
- 星标
- 5.2k
- 派生
- 420
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
salesforce/CodeGen 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 45/100
salesforce/CodeGen#107 ·
-
难度 5/5 一周以上 新手友好度 20/100
salesforce/CodeGen#104 ·
-
难度 5/5 一周以上 新手友好度 25/100
salesforce/CodeGen#101 ·
-
难度 1/5 1 小时以内 新手友好度 48/100
salesforce/CodeGen#95 ·
-
难度 3/5 1-2 天 新手友好度 35/100
salesforce/CodeGen#94 · 8 条评论 ·
查看 salesforce/CodeGen 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
solana-foundation/pay-kit#341 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
nasa/python_cmr#123 ·
-
难度 1/5 1 小时以内 新手友好度 92/100
EleutherAI/lm-evaluation-harness#4243 ·
维护者通常 1 天内回复
-
area: dashboard bug perceived difficulty: 3
难度 2/5 1-3 小时 新手友好度 88/100
Nitjsefnie-Harness-Commons/daedalus#1179 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 88/100
cusp-ai-oss/tojax#17 ·