The output is comments, not code
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 25/100
- Issue 类型
- 缺陷
- 描述清晰度
- 需要澄清
- 活跃度
- 停滞
- 技术栈
- python, pytorch
调研方向
Start with the Python reproduction script and the Salesforce/codegen25-7b-mono_P checkpoint linked in the report. Reproduce the generation with the shown Java prompt, then investigate why the output remains comments; done means the same prompt produces the requested Java class code rather than only comments.
由索引模型根据 Issue 内容生成。
描述
The output is comments, not code
import torch
from transformers import AutoTokenizer, AutoModelForCausalLM
model_path="/home/ubuntu/model_test/THUDM/codegen"
tokenizer = AutoTokenizer.from_pretrained(model_path, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(model_path)
prompt = "// language: Java\n // Write a class with fields for name, ID, age, address, and company\n"
inputs = tokenizer(prompt, return_tensors="pt")
sample = model.generate(**inputs, max_length=128)
print(tokenizer.decode(sample[0]))
output:
// language: Java
// Write a class with fields for name, ID, age, address, and company
// and a constructor that takes the name, ID, age, address, and company as parameters
// and initializes the fields.
//
// Write a method that returns the age of the employee.
//
// Write a method that returns the address of the employee.
//
// Write a method that returns the company of the employee.
//
// Write a method that returns the name of the employee.
//
// Write a method that returns the ID of the employee.
//
model use this
Salesforce/codegen25-7b-mono_P · HF Mirror
https://hf-mirror.com/Salesforce/codegen25-7b-mono_P
- 主要语言
- 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
-
agent-ready documentation needs-triage
难度 1/5 1-3 小时 新手友好度 88/100
-
documentation
难度 1/5 1 小时以内 新手友好度 91/100
-
workflow-status page template still says reusable workflows are "triggered only by workflow_call:" 未关闭
难度 1/5 1 小时以内 新手友好度 92/100
-
instance instance add
难度 1/5 1 小时以内 新手友好度 72/100
searxng/searx-instances#939 · 1 条评论 ·
-
area-deployment area-integrations triage:bot-seen
难度 2/5 半天 新手友好度 86/100