Skip to content

Commit

Permalink
Update tokenizers.js
Browse files Browse the repository at this point in the history
  • Loading branch information
xenova committed Mar 16, 2024
1 parent ae79420 commit 1ec55b3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/tokenizers.js
Original file line number Diff line number Diff line change
Expand Up @@ -2522,7 +2522,7 @@ export class PreTrainedTokenizer extends Callable {
if (Array.isArray(this.chat_template)) {
// Chat templates are stored as lists of dicts with fixed key names,
// we reconstruct that into a single dict while loading them.
const chat_template = {};
const chat_template = Object.create(null);
for (const item of this.chat_template) {
chat_template[item['name']] = item['template'];
}
Expand Down

0 comments on commit 1ec55b3

Please sign in to comment.