Commit 
							
							·
						
						90524fa
	
1
								Parent(s):
							
							d7a5265
								
Fix UnicodeDecodeError for "enron_emails" subset (#5)
Browse files- Ignore codec errors (b50c113a9b1c9d4223cc8770ecedabbe775f1a03)
- the_pile.py +1 -1
 
    	
        the_pile.py
    CHANGED
    
    | 
         @@ -237,7 +237,7 @@ class ThePile(datasets.GeneratorBasedBuilder): 
     | 
|
| 237 | 
         
             
                                    else:
         
     | 
| 238 | 
         
             
                                        id_ = path.split("/")[-1].split(".")[0]
         
     | 
| 239 | 
         
             
                                        meta = {"id": id_}
         
     | 
| 240 | 
         
            -
                                    text = file.read().decode("utf-8")
         
     | 
| 241 | 
         
             
                                    yield key, {
         
     | 
| 242 | 
         
             
                                        "text": text,
         
     | 
| 243 | 
         
             
                                        "meta": meta,
         
     | 
| 
         | 
|
| 237 | 
         
             
                                    else:
         
     | 
| 238 | 
         
             
                                        id_ = path.split("/")[-1].split(".")[0]
         
     | 
| 239 | 
         
             
                                        meta = {"id": id_}
         
     | 
| 240 | 
         
            +
                                    text = file.read().decode("utf-8", errors="ignore")  # encoding errors in enron_emails
         
     | 
| 241 | 
         
             
                                    yield key, {
         
     | 
| 242 | 
         
             
                                        "text": text,
         
     | 
| 243 | 
         
             
                                        "meta": meta,
         
     |