mirror of
https://github.com/HKUDS/LightRAG.git
synced 2025-08-13 03:00:48 +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,
|
set_all_update_flags,
|
||||||
)
|
)
|
||||||
|
|
||||||
import faiss # type: ignore
|
|
||||||
|
|
||||||
USE_GPU = os.getenv("FAISS_USE_GPU", "0") == "1"
|
USE_GPU = os.getenv("FAISS_USE_GPU", "0") == "1"
|
||||||
FAISS_PACKAGE = "faiss-gpu" if USE_GPU else "faiss-cpu"
|
FAISS_PACKAGE = "faiss-gpu" if USE_GPU else "faiss-cpu"
|
||||||
|
|
||||||
if not pm.is_installed(FAISS_PACKAGE):
|
if not pm.is_installed(FAISS_PACKAGE):
|
||||||
pm.install(FAISS_PACKAGE)
|
pm.install(FAISS_PACKAGE)
|
||||||
|
|
||||||
|
import faiss # type: ignore
|
||||||
|
|
||||||
|
|
||||||
@final
|
@final
|
||||||
@dataclass
|
@dataclass
|
||||||
|
Loading…
x
Reference in New Issue
Block a user