transformers pipelines with generator or dataset inputs record events before inference runs
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
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: aPipelineIteratoror 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
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de wild-edge/wildedge-python
-
Dificultad 4/5 3-5 días Aptitud para principiantes 45/100
wild-edge/wildedge-python#85 ·
Los mantenedores suelen responder en 1 día
-
vLLM integrationQuizá libre de nuevo @piotrekno1 la tomó hace 122 días y no hay ningún pull request abierto. Abierto
wild-edge/wildedge-python#38 · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
enhancement good first issue help wanted
Dificultad 3/5 1-2 días Aptitud para principiantes 48/100
wild-edge/wildedge-python#25 ·
Los mantenedores suelen responder en 1 día
-
enhancement good first issue help wanted
Dificultad 4/5 3-5 días Aptitud para principiantes 25/100
wild-edge/wildedge-python#22 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
enhancement good first issue help wanted
Dificultad 3/5 1-2 días Aptitud para principiantes 35/100
wild-edge/wildedge-python#20 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
Todos los issues de wild-edge/wildedge-python
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
foxglove/mcap#1907 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
namespace operations
Dificultad 1/5 Menos de una hora Aptitud para principiantes 72/100
EclipseFdn/open-vsx.org#14623 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
developmentseed/titiler-cmr#261 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
andrewyng/openworker#774 ·
Los mantenedores suelen responder en 1 día
-
aggfuncAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
worldbank/blackmarblepy#160 ·