Catch OSErrors in HuggingFaceDatasetSaver._deserialize_components (#9078)

* Update flagging.py

* add changeset

---------

Co-authored-by: Freddy Boulton <alfonsoboulton@gmail.com>
Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
This commit is contained in:
David Berenstein 2024-08-12 18:56:59 +02:00 committed by GitHub
parent 5350f1feb2
commit 1a9d7297c1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 1 deletions

View File

@ -0,0 +1,5 @@
---
"gradio": patch
---
fix:Catch OSErrors in `HuggingFaceDatasetSaver._deserialize_components`

View File

@ -430,7 +430,7 @@ class HuggingFaceDatasetSaver(FlaggingCallback):
if not deserialized_path.exists():
raise FileNotFoundError(f"File {deserialized} not found")
row.append(str(deserialized_path.relative_to(self.dataset_dir)))
except (FileNotFoundError, TypeError, ValueError):
except (FileNotFoundError, TypeError, ValueError, OSError):
deserialized = "" if deserialized is None else str(deserialized)
row.append(deserialized)