The output is comments, not code
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 25/100
- Tipo di issue
- Bug
- Chiarezza
- Da chiarire
- Stato di attività
- Ferma
- Stack tecnologico
- python, pytorch
- Ambito
- machine-learning
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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
- Lingua principale
- Python
- Stelle
- 5.2k
- Fork
- 420
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di salesforce/CodeGen
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 45/100
salesforce/CodeGen#107 ·
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 20/100
salesforce/CodeGen#104 ·
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
salesforce/CodeGen#101 ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 48/100
salesforce/CodeGen#95 ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 35/100
salesforce/CodeGen#94 · 8 commenti ·
Tutte le issue di salesforce/CodeGen
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
browser-use/browser-use#5905 ·
-
type: enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
ynput/ayon-python-api#363 ·
-
bug needs triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
modelscope/FunASR#3728 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
open-compass/opencompass#2655 ·