search-restore-2
Some checks failed
Deploy on push / deploy (push) Failing after 9s

This commit is contained in:
2025-09-01 15:19:05 +03:00
parent 4489d25913
commit a1e4d0d391
3 changed files with 13 additions and 5 deletions

View File

@@ -1,6 +1,6 @@
[project]
name = "discours-core"
version = "0.9.14"
version = "0.9.18"
description = "Core backend for Discours.io platform"
authors = [
{name = "Tony Rewin", email = "tonyrewin@yandex.ru"}

View File

@@ -15,17 +15,21 @@ def get_models_cache_dir() -> str:
"""Определяет лучшую папку для кеша моделей"""
# Пробуем /dump если доступен для записи
dump_path = Path("/dump")
print(f"🔍 Checking /dump - exists: {dump_path.exists()}, writable: {os.access('/dump', os.W_OK) if dump_path.exists() else 'N/A'}")
if dump_path.exists() and os.access("/dump", os.W_OK):
cache_dir = "/dump/huggingface"
try:
Path(cache_dir).mkdir(parents=True, exist_ok=True)
print(f"✅ Using mounted storage: {cache_dir}")
return cache_dir
except Exception: # noqa: S110
pass
except Exception as e:
print(f"❌ Failed to create {cache_dir}: {e}")
# Fallback - локальная папка ./dump
cache_dir = "./dump/huggingface"
Path(cache_dir).mkdir(parents=True, exist_ok=True)
print(f"📁 Using local fallback: {cache_dir}")
return cache_dir

View File

@@ -22,17 +22,21 @@ def get_models_cache_dir() -> str:
"""Определяет лучшую папку для кеша моделей"""
# Пробуем /dump если доступен для записи
dump_path = Path("/dump")
logger.info(f"🔍 Checking /dump - exists: {dump_path.exists()}, writable: {os.access('/dump', os.W_OK) if dump_path.exists() else 'N/A'}")
if dump_path.exists() and os.access("/dump", os.W_OK):
cache_dir = "/dump/huggingface"
try:
Path(cache_dir).mkdir(parents=True, exist_ok=True)
logger.info(f"✅ Using mounted storage: {cache_dir}")
return cache_dir
except Exception: # noqa: S110
pass
except Exception as e:
logger.warning(f"Failed to create {cache_dir}: {e}")
# Fallback - локальная папка ./dump
cache_dir = "./dump/huggingface"
Path(cache_dir).mkdir(parents=True, exist_ok=True)
logger.info(f"📁 Using local fallback: {cache_dir}")
return cache_dir