Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#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
You can’t perform that action at this time.