def _clear_caches():
    """
    Clears in-memory transformer and tokenizer caches.
    """
    global _model_cache
    global _tokenizer_cache
    _model_cache.clear()
    _tokenizer_cache.clear()
Clears in-memory transformer and tokenizer caches.
allennlp/common/cached_transformers.py