Created
August 31, 2019 05:55
-
-
Save bhavsarpratik/129ccffc7d37f4b7509f999be5f5870d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Earlier | |
language_model.get_sentence_embedding(sentence) | |
#Later | |
from cachetools import LRUCache, cached | |
@cached(cache=LRUCache(maxsize=10000)) | |
def get_sentence_embedding(sentence): | |
return language_model.get_sentence_embedding(sentence) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment