Spaces:
Sleeping
Sleeping
update
Browse files
main.py
CHANGED
@@ -1,4 +1,5 @@
|
|
1 |
from contextlib import asynccontextmanager
|
|
|
2 |
from typing import Annotated
|
3 |
import dotenv
|
4 |
import uvicorn
|
@@ -42,13 +43,13 @@ configure_logging(
|
|
42 |
config_file_path=config.common_config.log_file_path,
|
43 |
)
|
44 |
|
|
|
|
|
45 |
|
46 |
print("Downloading model to cache...")
|
47 |
AutoTokenizer.from_pretrained(config.db_config.faiss.model_embedding_path)
|
48 |
AutoModel.from_pretrained(config.db_config.faiss.model_embedding_path)
|
49 |
-
|
50 |
print("Model cached successfully.")
|
51 |
-
|
52 |
|
53 |
app = FastAPI(title="Assistant control panel")
|
54 |
|
|
|
1 |
from contextlib import asynccontextmanager
|
2 |
+
from pathlib import Path
|
3 |
from typing import Annotated
|
4 |
import dotenv
|
5 |
import uvicorn
|
|
|
43 |
config_file_path=config.common_config.log_file_path,
|
44 |
)
|
45 |
|
46 |
+
# Костыль №47364: Удаляем файл статуса обработки датасета при запуске приложения
|
47 |
+
Path(os.environ.get("APP_TMP_PATH", '.') / 'tmp.json').unlink(missing_ok=True)
|
48 |
|
49 |
print("Downloading model to cache...")
|
50 |
AutoTokenizer.from_pretrained(config.db_config.faiss.model_embedding_path)
|
51 |
AutoModel.from_pretrained(config.db_config.faiss.model_embedding_path)
|
|
|
52 |
print("Model cached successfully.")
|
|
|
53 |
|
54 |
app = FastAPI(title="Assistant control panel")
|
55 |
|