mirror of
https://github.com/zylon-ai/private-gpt.git
synced 2025-12-22 20:12:55 +01:00
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:
parent
8119842ae6
commit
7ee6ac16ec
3 changed files with 6 additions and 0 deletions
|
|
@ -31,6 +31,7 @@ class EmbeddingComponent:
|
||||||
self.embedding_model = HuggingFaceEmbedding(
|
self.embedding_model = HuggingFaceEmbedding(
|
||||||
model_name=settings.huggingface.embedding_hf_model_name,
|
model_name=settings.huggingface.embedding_hf_model_name,
|
||||||
cache_folder=str(models_cache_path),
|
cache_folder=str(models_cache_path),
|
||||||
|
trust_remote_code=settings.huggingface.trust_remote_code,
|
||||||
)
|
)
|
||||||
case "sagemaker":
|
case "sagemaker":
|
||||||
try:
|
try:
|
||||||
|
|
|
||||||
|
|
@ -189,6 +189,10 @@ class HuggingFaceSettings(BaseModel):
|
||||||
None,
|
None,
|
||||||
description="Huggingface access token, required to download some models",
|
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):
|
class EmbeddingSettings(BaseModel):
|
||||||
|
|
|
||||||
|
|
@ -91,6 +91,7 @@ embedding:
|
||||||
huggingface:
|
huggingface:
|
||||||
embedding_hf_model_name: nomic-ai/nomic-embed-text-v1.5
|
embedding_hf_model_name: nomic-ai/nomic-embed-text-v1.5
|
||||||
access_token: ${HF_TOKEN:}
|
access_token: ${HF_TOKEN:}
|
||||||
|
trust_remote_code: false
|
||||||
|
|
||||||
vectorstore:
|
vectorstore:
|
||||||
database: qdrant
|
database: qdrant
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue