Skip to content

Conversation

@xenova
Copy link
Collaborator

@xenova xenova commented Jun 20, 2023

Fixes "Maximum call stack size exceeded" which is caused by using the spread operator to concatenate large arrays.

@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented Jun 20, 2023

The documentation is not available anymore as the PR was closed or merged.

@xenova xenova merged commit 4804171 into main Jun 20, 2023
it('should not crash when encoding a very long string', async () => {
let tokenizer = await AutoTokenizer.from_pretrained('t5-small');

let text = String.prototype.repeat.call('Hello world! ', 50000);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'Hello world! '.repeat(50000); 🤌

Kinda sad to see the nice array spreading syntax gone, but this is the reality of large arrays, nice work 🥇

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants