Skip to content

Commit 1cbc0d1

Browse files
committed
Fix loading weights whose name is UpperCase
1 parent d319c61 commit 1cbc0d1

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/utils.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -292,5 +292,8 @@ export function toCamelCase(e: string) {
292292
}
293293

294294
export function toSnakeCase(e: string) {
295+
// Do not convert if the first character is upper case.
296+
if (e.length > 0 && e[0] == e[0].toUpperCase())
297+
return e;
295298
return e.replace(/[A-Z]/g, (ch, i) => i ? '_' + ch.toLowerCase() : ch.toLowerCase());
296-
}
299+
}

0 commit comments

Comments
 (0)