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

transformers pipelines with generator or dataset inputs record events before inference runs

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

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
55/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
huggingface, python, pytorch

Línea de trabajo

Start by reading the transformers Pipeline.call patch and the model forward hooks, then trace how a returned PipelineIterator is consumed. Reproduce with a generator input and compare event count, timing, and outputs with an eager call. Done means lazy inference is tracked at the intended granularity and forward hooks do not add per-item events.

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

Descripción

What happens

When a transformers pipeline is called with a generator, a dataset or another lazy input, Pipeline.__call__ returns a PipelineIterator, and inference runs only as that iterator is consumed. The integration's Pipeline.__call__ patch records its success event when __call__ returns, before any inference has run. Then each consumed item runs the model outside the tracked call, so the model's forward hooks record one event per item.

Checked with transformers 5.20.1 and the fix from #77:

Call Events
clf("hello world") 1 pipeline event (correct)
out = clf(x for x in ["hello", "world"]) 1 pipeline event right away: no input_meta, near-zero duration, before any inference
list(out) 2 more model events, one per item

So two inputs produce three events, and the first one's duration and success don't describe any real inference.

Expected

For a lazy input, record one event per item as the iterator is consumed (with its duration and output), or one event when it's exhausted. No event should be recorded when __call__ returns the iterator. The model's forward hooks should stay quiet while the iterator is being consumed.

Notes

  • This predates #77; #77 only stops eager calls from being counted twice.
  • Pipeline.__call__ decides this based on input type (types.GeneratorType, Dataset, KeyDataset), so the patch can tell from the return value: a PipelineIterator or another iterator instead of a list or dict.

🤖 Generated with Claude Code

Lenguaje dominante
Python
Estrellas
17
Forks
1
Merge medio
17 h 5 min
PR fusionados (30 d)
34

Preparar el entorno

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 wild-edge/wildedge-python

Todos los issues de wild-edge/wildedge-python

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.