# Display stream length

**URL:** <https://support.prodi.gy/t/display-stream-length/872>\
**Category:** Uncategorized\
**Tags:** front-end, solved\
**Created:** [October 11, 2018, 4:48am UTC](https://support.prodi.gy/t/display-stream-length/872 "2018-10-11T04:48:22Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![ines](https://sea2.discourse-cdn.com/flex020/user_avatar/support.prodi.gy/ines/32/3_2.png) [@ines](https://support.prodi.gy/u/ines)\
**Post date:** [October 11, 2018, 11:09am UTC](https://support.prodi.gy/t/display-stream-length/872/2 "2018-10-11T11:09:59Z")

</div>

Yes, this actually just came up in a different thread. Here's some background on when the stream length is shown vs. when the stream is displayed as infinite:

> [@ner.manual - simple usage](https://support.prodi.gy/t/ner-manual-simple-usage/862/4):
>
> By default, Prodigy streams are generators and if a file can be read in line-by-line, Prodigy will do so and start yielding out tasks immediately. Generators have no length, because they don’t know how many items there are in total. And if Prodigy doesn’t know how many items there are in total, it can’t display the progress.

You can try making the following edit in your recipe:

> [@ner.manual - simple usage](https://support.prodi.gy/t/ner-manual-simple-usage/862/4):
>
> the idea is that the _recipe_ needs to return a `stream` that exposes a ` __len__ ` (i.e. a length, which is the case for regular lists, but not generators). So try converting the `stream` as late as possible in the recipe:
> 
> ```python
> stream = add_tokens(nlp, stream)
> stream = list(stream)
> 
> ```

You can also supply your own custom `progress` function via the recipe options. This is useful if you want to calculate the remaining examples dynamically (e.g. by checking your database).

---

_[View the full topic](https://support.prodi.gy/t/display-stream-length/872)._
