Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

The output is comments, not code

Abierto
#93 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
25/100
Tipo de issue
Error
Claridad
Necesita aclaración
Estado de actividad
Estancado
Stack tecnológico
python, pytorch

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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

Lenguaje dominante
Python
Estrellas
5.2k
Forks
420
Métricas de merge de PR
Sin PR fusionados en 30 d

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de salesforce/CodeGen

Todos los issues de salesforce/CodeGen

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.