mirror of
				https://github.com/HKUDS/LightRAG.git
				synced 2025-11-04 03:39:35 +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