INNER CODE UNIT · Python
_migrate_temp_hf_cache
onyx-dot-app/onyx · backend/model_server/main.py:73
def _migrate_temp_hf_cache() -> None:
if not TEMP_HF_CACHE_PATH.is_dir():
return
logger.notice("Moving contents of temp_huggingface to huggingface cache.")
_move_files_recursively(TEMP_HF_CACHE_PATH, HF_CACHE_PATH)
shutil.rmtree(TEMP_HF_CACHE_PATH, ignore_errors=True)
logger.notice("Moved contents of temp_huggingface to huggingface cache.")
@asynccontextmanager
async def lifespan(app: FastAPI) -> AsyncGenerator:
gpu_type = get_gpu_type()
logger.notice("Torch GPU Detection: gpu_type=%s", gpu_type)
app.state.gpu_type = gpu_type
try: