Skip to content

Bff/token optimisation - #268

Open
benjaminfh wants to merge 29 commits into
clovaai:masterfrom
benjaminfh:bff/token-optimisation
Open

Bff/token optimisation#268
benjaminfh wants to merge 29 commits into
clovaai:masterfrom
benjaminfh:bff/token-optimisation

Conversation

@benjaminfh

@benjaminfh benjaminfh commented Nov 1, 2023

Copy link
Copy Markdown

PR to fix: #266

@bugface

bugface commented Nov 14, 2023

Copy link
Copy Markdown

This is very useful!

One small findings:
add .DS_Store into gitignore or remove it.

@benjaminfh

benjaminfh commented Nov 14, 2023

Copy link
Copy Markdown
Author

Ah yes, thanks for catching that - removed the file.

I should have put some context in the original PR. This is to fix the issue I flagged here #266

@benjaminfh

Copy link
Copy Markdown
Author

@bugface – let me know if you're happy to merge :)

@bugface

bugface commented Nov 22, 2023

Copy link
Copy Markdown

@bugface – let me know if you're happy to merge :)

I think it looks great.

@benjaminfh
benjaminfh marked this pull request as ready for review November 22, 2023 19:21
@benjaminfh

Copy link
Copy Markdown
Author

I think we're good to merge then, @bugface :)

@msciancalepore98

Copy link
Copy Markdown

news about this? @bugface

@matteocacciola matteocacciola left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

If the default value of replace_additional_special_tokens is False, why do you assign False value when you explicit its usage?

@benjaminfh

Copy link
Copy Markdown
Author

Ah yeah, I guess bad style. At the time I wanted to be explicit because this bug was so opaque. Are you happy to merge if I fix that?

@matteocacciola

matteocacciola commented Jul 11, 2024 via email

Copy link
Copy Markdown

Comment thread donut/model.py
if len(set(list_of_tokens) - set(self.tokenizer.all_special_tokens)) > 0:
newly_added_num = self.tokenizer.add_special_tokens({"additional_special_tokens": sorted(set(list_of_tokens))}, replace_additional_special_tokens=replace_additional_special_tokens)
else:
newly_added_num = 0

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I guess this is the real solution to the detected bug, isn't it?

matteocacciola added a commit to matteocacciola/donut that referenced this pull request Jul 11, 2024
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.

json2token performance

4 participants