[PR #374] remove unnecessary cache in simple tokenizer #494

Open
opened 2026-10-31 21:15:30 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/openai/CLIP/pull/374
Author: @aisk
Created: 7/10/2023
Status: 🔄 Open

Base: main ← Head: main


📝 Commits (1)

  • 77c7ef0 remove unnecessary cache in simple tokenizer

📊 Changes

1 file changed (+0 additions, -1 deletions)

View changed files

📝 clip/simple_tokenizer.py (+0 -1)

📄 Description

The default_bpe() is called as default parameter in constructor of SimpleTokenizer. Since python's function default parameters only execute once when the function definition is executed, so there is no need to cache it, and the operation is not so expensive.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/openai/CLIP/pull/374 **Author:** [@aisk](https://github.com/aisk) **Created:** 7/10/2023 **Status:** 🔄 Open **Base:** `main` ← **Head:** `main` --- ### 📝 Commits (1) - [`77c7ef0`](https://github.com/openai/CLIP/commit/77c7ef03fdde3a83f6369023ed0c6523cd6ed860) remove unnecessary cache in simple tokenizer ### 📊 Changes **1 file changed** (+0 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `clip/simple_tokenizer.py` (+0 -1) </details> ### 📄 Description The `default_bpe()` is called as default parameter in constructor of SimpleTokenizer. Since python's [function default parameters only execute once when the function definition is executed](https://docs.python.org/3.5/reference/compound_stmts.html#function-definitions), so there is no need to cache it, and the operation is not so expensive. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
openai/CLIP#494
No description provided.