transformers pipelines with generator or dataset inputs record events before inference runs
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 55/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Lĩnh vực
- machine-learning, observability
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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
- Ngôn ngữ chính
- Python
- Star
- 17
- Fork
- 1
- Merge trung bình
- 17 giờ 5 phút
- Pull request đã merge (30 ngày)
- 34
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của wild-edge/wildedge-python
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
wild-edge/wildedge-python#85 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
vLLM integrationCó thể làm lại được @piotrekno1 đã nhận 121 ngày trước và không có pull request nào đang mở. Đang mở
wild-edge/wildedge-python#38 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement good first issue help wanted
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 48/100
wild-edge/wildedge-python#25 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement good first issue help wanted
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
wild-edge/wildedge-python#22 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement good first issue help wanted
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
wild-edge/wildedge-python#20 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của wild-edge/wildedge-python
Issue tương tự
-
infrastructure
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
khuisman/mcp-gee-sweet#1152 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
-
backroom bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
ditto-assistant/ditto-subnet#3069 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
open-webui/open-webui#32901 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
0.3.3 bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày