mirror of
https://github.com/tiennm99/DocsGPT.git
synced 2026-10-15 08:16:38 +00:00
build(docker): pin onnxruntime threads in the image
OMP_NUM_THREADS=4 capped torch in the old image, but FastEmbed runs on onnxruntime, which ignores it and sizes its pool to the host's core count. A CPU-limited container still reports every host core, so embedding ran with 64 threads on a 4-CPU sandbox and took up to 12x longer per file. The image now sets EMBEDDINGS_THREADS=4 next to the existing caps; the settings guide documents the knob.
This commit is contained in:
1 parent
482e043e67
commit
03cc60d481
2 files changed
+6
-1
No files matched your search
@@ -471,6 +471,7 @@ See [Embeddings](/Models/embeddings) for full guidance.
|
||||
| --- | --- | --- |
|
||||
| `EMBEDDINGS_NAME` | `huggingface_sentence-transformers/all-mpnet-base-v2` | The embedding model. New installs use `ibm-granite/granite-embedding-311m-multilingual-r2`. Changing it on a populated index requires `application.scripts.reembed`. |
|
||||
| `EMBEDDINGS_BASE_URL` | unset | Base URL of a remote OpenAI-compatible embeddings server. Setting it routes all embedding calls there. |
|
||||
| `EMBEDDINGS_THREADS` | unset (Docker image: `4`) | Threads one local FastEmbed/onnxruntime session may use. onnxruntime otherwise sizes its pool to the host's core count, which a CPU-limited container still reports, so the image pins it like `OMP_NUM_THREADS`. Raise it on a large dedicated worker. |
|
||||
| `EMBEDDINGS_KEY` | unset | Optional bearer token for the remote embeddings server. |
|
||||
| `EMBEDDINGS_MAX_INPUT_TOKENS` | unset | Truncate each remote embedding input to N tokens (guards servers that reject oversized inputs). |
|
||||
| `EMBEDDINGS_DELEGATE_TO_WORKER` | `true` | Embed queries on the Celery worker instead of loading a model in the API. Requires a worker consuming `EMBEDDINGS_QUEUE`; set `false` to run the API standalone. Ignored when `EMBEDDINGS_BASE_URL` is set. |
|
||||
|
||||
Reference in new issue
Block a user