Timothy J. Baek преди 7 месеца
родител
ревизия
39c57c0e94
променени са 1 файла, в които са добавени 3 реда и са изтрити 5 реда
  1. 3 5
      backend/open_webui/apps/rag/main.py

+ 3 - 5
backend/open_webui/apps/rag/main.py

@@ -212,11 +212,9 @@ def update_reranking_model(
                         # and the following error is thrown:
                         # /root/.cache/torch_extensions/py311_cpu/segmented_maxsim_cpp/segmented_maxsim_cpp.so: cannot open shared object file: No such file or directory
 
-                        torch_extensions = "/root/.cache/torch_extensions/py311_cpu"
-                        try:
-                            shutil.rmtree(torch_extensions)
-                        except:
-                            pass
+                        lock_file = "/root/.cache/torch_extensions/py311_cpu/segmented_maxsim_cpp/lock"
+                        if os.path.exists(lock_file):
+                            os.remove(lock_file)
 
                     self.ckpt = Checkpoint(
                         name,