# Dataset.map Ignore failed batches

**URL:** <https://discuss.huggingface.co/t/dataset-map-ignore-failed-batches/158906>\
**Category:** 🤗Datasets\
**Created:** [June 11, 2025, 11:16am UTC](https://discuss.huggingface.co/t/dataset-map-ignore-failed-batches/158906 "2025-06-11T11:16:01Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![John6666](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/john6666/32/27664_2.png) [@John6666](https://discuss.huggingface.co/u/John6666)\
**Post date:** [June 11, 2025, 11:39am UTC](https://discuss.huggingface.co/t/dataset-map-ignore-failed-batches/158906/2 "2025-06-11T11:39:10Z")

</div>

For example, how about just use Python Exception?

> [@Saving outcomes if Error while applying map function on dataset](https://discuss.huggingface.co/t/saving-outcomes-if-error-while-applying-map-function-on-dataset/31614):
>
> I use an API (like huggingface\_hub) to let a language model answer questions from my dataset. Since I want to send every single example to the language model, I wrote a function that does that and then use the map function to map this API call to every example of my dataset. My issue is: If there is an Error at any point (e.g. the API throws an Error after one hour, because sth happend) I loose all the information. Lets say the map worked for the first 100 examples and then the API throws an E…

---

_[View the full topic](https://discuss.huggingface.co/t/dataset-map-ignore-failed-batches/158906)._
