From 39c57c0e942250ddc81defe78e0bddc0825b32c6 Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Thu, 19 Sep 2024 22:40:06 +0200 Subject: [PATCH] refac --- backend/open_webui/apps/rag/main.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/backend/open_webui/apps/rag/main.py b/backend/open_webui/apps/rag/main.py index 5a228fcea..981a6fe5b 100644 --- a/backend/open_webui/apps/rag/main.py +++ b/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,