Closed 01PAfXWT closed 4 months ago
@01PAfXWT Hi, same situation here. did you find any solution for this?
To set the trust_remote_code
option in privateGPT, you need to modify the following code sections:
1) add definition of trust_remote_code
to private_gpt\settings\settings.py
, the default value is set to False.
class HuggingFaceSettings(BaseModel):
embedding_hf_model_name: str = Field(
description="Name of the HuggingFace model to use for embeddings"
)
access_token: str = Field(
None,
description="Huggingface access token, required to download some models",
)
trust_remote_code: bool = Field(
False,
description="Trust remote code when downloading models",
)
2) insert trust_remote_code=settings.huggingface.trust_remote_code,
to private_gpt\components\embedding\embedding_component.py
:
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,
)
3) finally, add trust_remote_code:true
to settings-{profile}.yaml
huggingface:
embedding_hf_model_name: nomic-ai/nomic-embed-text-v1.5
access_token: ${HUGGINGFACE_TOKEN:********}
trust_remote_code: true
Above modifications work for me.
@01PAfXWT Worked like a charm, thanks mate 👍
First of all, grateful thanks to the authors of privateGPT for developing such a great app.
However, when I tried to use
nomic-ai/nomic-embed-text-v1.5
from huggingface.co as an embedding model coupled with llamacpp for local setups, an error occurred as follows:I am wondering how I can set the
trust_remote_code=True
option and properly pass it to privateGPT. I tried insertingtrust_remote_code: true
in thehuggingface
orllamacpp
section in the yaml file, but it did not work.The following is my configuration profile.
Any suggestions? Thank you.