mirror of
https://github.com/HKUDS/LightRAG.git
synced 2025-08-12 18:50:47 +00:00
Fix faisss import error
This commit is contained in:
parent
531502677e
commit
810676d54c
@ -17,14 +17,13 @@ from .shared_storage import (
|
||||
set_all_update_flags,
|
||||
)
|
||||
|
||||
import faiss # type: ignore
|
||||
|
||||
USE_GPU = os.getenv("FAISS_USE_GPU", "0") == "1"
|
||||
FAISS_PACKAGE = "faiss-gpu" if USE_GPU else "faiss-cpu"
|
||||
|
||||
if not pm.is_installed(FAISS_PACKAGE):
|
||||
pm.install(FAISS_PACKAGE)
|
||||
|
||||
import faiss # type: ignore
|
||||
|
||||
|
||||
@final
|
||||
@dataclass
|
||||
|
Loading…
x
Reference in New Issue
Block a user