Skip to content

Commit 6b05a56

Browse files
authored
Added docs about trust remote code and huggingface authentication (#1665)
1 parent 4059799 commit 6b05a56

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

pgml-cms/docs/open-source/korvus/guides/constructing-pipelines.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,3 +162,48 @@ pipeline = Pipeline(
162162
The `Pipeline` above generates embeddings and tsvectors for the `abstract` and splits and generates embeddings and tsvectors for the `text`.
163163

164164
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.
165+
166+
## Self-Hosting Specific Parameters
167+
168+
**This section is only relevant for self hosted instances of PostgresML**. These parameters are never required for instances hosted by PostgresML.
169+
170+
### Trust Remote Code
171+
172+
Some HuggingFace models require the argument `trust_remote_code=true`. To enable this, pass it as a parameter in the pipeline construction:
173+
174+
```python
175+
pipeline = Pipeline(
176+
"v0",
177+
{
178+
"text": {
179+
"semantic_search": {
180+
"model": "Alibaba-NLP/gte-base-en-v1.5",
181+
"parameters": {
182+
"trust_remote_code": True
183+
}
184+
}
185+
}
186+
}
187+
)
188+
```
189+
190+
### HuggingFace authentication
191+
192+
Pass your HuggingFace token into the pipeline to access gated repos:
193+
194+
```python
195+
pipeline = Pipeline(
196+
"v0",
197+
{
198+
"text": {
199+
"semantic_search": {
200+
"model": "Alibaba-NLP/gte-base-en-v1.5",
201+
"parameters": {
202+
"trust_remote_code": True,
203+
"token": "YOUR_TOKEN"
204+
}
205+
}
206+
}
207+
}
208+
)
209+
```

0 commit comments

Comments
 (0)