Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

The output is comments, not code

Aperta
#93 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

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

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

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di salesforce/CodeGen

Tutte le issue di salesforce/CodeGen

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.