docker-api / nodes /check_cache.py
dasomaru's picture
Upload folder using huggingface_hub
06696b5 verified
raw
history blame contribute delete
353 Bytes
from utils.cache import get_cached_response
def check_cache(state):
query = state.query
top_k = getattr(state, "top_k", 5)
cached = get_cached_response(query, top_k)
if cached:
return state.copy(update={
"cached_response": cached,
"final_response": cached
})
return state