meg HF Staff commited on
Commit
6a538fd
·
verified ·
1 Parent(s): 434f8a6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -3,8 +3,9 @@ import gradio as gr
3
  import random
4
  import time
5
  from datasets import load_dataset, Dataset
6
- from PIL import PngImagePlugin
7
- PngImagePlugin.MAX_TEXT_CHUNK = 1048576 * 10 # this is the current value
 
8
  """
9
  This code is designed to read in the ImageNet 1K ILSVRC dataset from the Hugging Face Hub,
10
  then create a new version of this dataset with {percentage} lines with random labels between 0-9,
 
3
  import random
4
  import time
5
  from datasets import load_dataset, Dataset
6
+ from PIL import PngImagePlugin, ImageFile
7
+ ImageFile.LOAD_TRUNCATED_IMAGES = True
8
+ PngImagePlugin.MAX_TEXT_CHUNK = 1048576 * 10 # this is 10x the amount.
9
  """
10
  This code is designed to read in the ImageNet 1K ILSVRC dataset from the Hugging Face Hub,
11
  then create a new version of this dataset with {percentage} lines with random labels between 0-9,