fix: allow to configure trust_remote_code

based on: https://github.com/zylon-ai/private-gpt/issues/1893#issuecomment-2118629391
This commit is contained in:
Javier Martinez 2024-08-01 09:35:46 +02:00
parent 8119842ae6
commit 7ee6ac16ec
No known key found for this signature in database
3 changed files with 6 additions and 0 deletions

View file

@ -31,6 +31,7 @@ class EmbeddingComponent:
self.embedding_model = HuggingFaceEmbedding(
model_name=settings.huggingface.embedding_hf_model_name,
cache_folder=str(models_cache_path),
trust_remote_code=settings.huggingface.trust_remote_code,
)
case "sagemaker":
try:

View file

@ -189,6 +189,10 @@ class HuggingFaceSettings(BaseModel):
None,
description="Huggingface access token, required to download some models",
)
trust_remote_code: bool = Field(
False,
description="If set to True, the code from the remote model will be trusted and executed.",
)
class EmbeddingSettings(BaseModel):

View file

@ -91,6 +91,7 @@ embedding:
huggingface:
embedding_hf_model_name: nomic-ai/nomic-embed-text-v1.5
access_token: ${HF_TOKEN:}
trust_remote_code: false
vectorstore:
database: qdrant