mirror of
https://github.com/open-webui/open-webui
synced 2024-11-16 05:24:02 +00:00
refac
This commit is contained in:
parent
4e43663448
commit
9be73ea94a
@ -76,7 +76,7 @@ ENV RAG_EMBEDDING_MODEL="$USE_EMBEDDING_MODEL_DOCKER" \
|
|||||||
ENV HF_HOME="/app/backend/data/cache/embedding/models"
|
ENV HF_HOME="/app/backend/data/cache/embedding/models"
|
||||||
|
|
||||||
## Torch Extensions ##
|
## Torch Extensions ##
|
||||||
ENV TORCH_EXTENSIONS_DIR="/.cache/torch_extensions"
|
# ENV TORCH_EXTENSIONS_DIR="/.cache/torch_extensions"
|
||||||
|
|
||||||
#### Other models ##########################################################
|
#### Other models ##########################################################
|
||||||
|
|
||||||
|
@ -206,6 +206,18 @@ def update_reranking_model(
|
|||||||
print("ColBERT: Loading model", name)
|
print("ColBERT: Loading model", name)
|
||||||
self.device = "cuda" if torch.cuda.is_available() else "cpu"
|
self.device = "cuda" if torch.cuda.is_available() else "cpu"
|
||||||
|
|
||||||
|
if DOCKER:
|
||||||
|
# This is a workaround for the issue with the docker container
|
||||||
|
# where the torch extension is not loaded properly
|
||||||
|
# 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
|
||||||
|
|
||||||
self.ckpt = Checkpoint(
|
self.ckpt = Checkpoint(
|
||||||
name,
|
name,
|
||||||
colbert_config=ColBERTConfig(model_name=name),
|
colbert_config=ColBERTConfig(model_name=name),
|
||||||
|
Loading…
Reference in New Issue
Block a user