File size: 622 Bytes
ddda149
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
e6de9e2
 
 
 
ddda149
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
"""HuggingFace Space entrypoint for the project-specific LightRAG config."""

from pathlib import Path
import os

from dotenv import load_dotenv


def load_huggingface_config() -> None:
    env_path = Path(os.getenv("LIGHTRAG_HUGGINGFACE_ENV", "/app/.env.huggingface"))
    if env_path.exists():
        load_dotenv(dotenv_path=env_path, override=True)


load_huggingface_config()

if os.getenv("LIGHTWEIGHT_LEGAL_RAG", "true").lower() == "true":
    from lightrag.api.legal_rag_server import main  # noqa: E402
else:
    from lightrag.api.lightrag_server import main  # noqa: E402


if __name__ == "__main__":
    main()