File tree 2 files changed +7
-2
lines changed
2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -455,7 +455,10 @@ impl CoreBPE {
455
455
let decoder: HashMap < usize , Vec < u8 > > =
456
456
encoder. iter ( ) . map ( |( k, v) | ( * v, k. clone ( ) ) ) . collect ( ) ;
457
457
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
+ ) ;
459
462
460
463
let special_tokens_decoder: HashMap < usize , Vec < u8 > > = special_tokens_encoder
461
464
. iter ( )
Original file line number Diff line number Diff line change @@ -21,7 +21,9 @@ def read_file(blobpath: str) -> bytes:
21
21
with blobfile .BlobFile (blobpath , "rb" ) as f :
22
22
return f .read ()
23
23
# 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
25
27
26
28
27
29
def read_file_cached (blobpath : str ) -> bytes :
You can’t perform that action at this time.
0 commit comments