File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -455,7 +455,10 @@ impl CoreBPE {
455455 let decoder: HashMap < usize , Vec < u8 > > =
456456 encoder. iter ( ) . map ( |( k, v) | ( * v, k. clone ( ) ) ) . collect ( ) ;
457457
458- assert ! ( encoder. len( ) == decoder. len( ) ) ;
458+ assert ! (
459+ encoder. len( ) == decoder. len( ) ,
460+ "Encoder and decoder must be of equal length; maybe you had duplicate token indices in your encoder?"
461+ ) ;
459462
460463 let special_tokens_decoder: HashMap < usize , Vec < u8 > > = special_tokens_encoder
461464 . iter ( )
Original file line number Diff line number Diff line change @@ -21,7 +21,9 @@ def read_file(blobpath: str) -> bytes:
2121 with blobfile .BlobFile (blobpath , "rb" ) as f :
2222 return f .read ()
2323 # avoiding blobfile for public files helps avoid auth issues, like MFA prompts
24- return requests .get (blobpath ).content
24+ resp = requests .get (blobpath )
25+ resp .raise_for_status ()
26+ return resp .content
2527
2628
2729def read_file_cached (blobpath : str ) -> bytes :
You can’t perform that action at this time.
0 commit comments