Skip to content

Added docs about trust remote code and huggingface authentication #1665

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 14, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions pgml-cms/docs/open-source/korvus/guides/constructing-pipelines.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,3 +162,48 @@ pipeline = Pipeline(
The `Pipeline` above generates embeddings and tsvectors for the `abstract` and splits and generates embeddings and tsvectors for the `text`.

We can now perform search over both the `text` and `abstract` key of our documents. See the [guide for vector search](vector-search) for more information on how to do this.

## Self-Hosting Specific Parameters

**This section is only relevant for self hosted instances of PostgresML**. These parameters are never required for instances hosted by PostgresML.

### Trust Remote Code

Some HuggingFace models require the argument `trust_remote_code=true`. To enable this, pass it as a parameter in the pipeline construction:

```python
pipeline = Pipeline(
"v0",
{
"text": {
"semantic_search": {
"model": "Alibaba-NLP/gte-base-en-v1.5",
"parameters": {
"trust_remote_code": True
}
}
}
}
)
```

### HuggingFace authentication

Pass your HuggingFace token into the pipeline to access gated repos:

```python
pipeline = Pipeline(
"v0",
{
"text": {
"semantic_search": {
"model": "Alibaba-NLP/gte-base-en-v1.5",
"parameters": {
"trust_remote_code": True,
"token": "YOUR_TOKEN"
}
}
}
}
)
```