You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[refactor] Refactor AI provider registration and introduce HuggingFace and TensorFlow MediaPipe providers
- Replaced `register_HFT_InlineJobFns` and `register_HFT_ClientJobFns` with `HuggingFaceTransformersProvider` and `TensorFlowMediaPipeProvider` for improved modularity and clarity.
- Updated documentation and examples to reflect the new provider registration methods.
- Enhanced worker registration for HuggingFace and TensorFlow MediaPipe tasks, streamlining the integration of AI models.
- Removed deprecated registration functions to clean up the codebase.
@@ -218,17 +218,17 @@ You can use as much or as little "magic" as you want. The config helpers are the
218
218
219
219
Tasks are agnostic to the provider. Text embedding can be done with several providers, such as Hugging Face Transformers (ONNX) or MediaPipe locally, or OpenAI etc via API calls.
220
220
221
-
- **`register_HFT_InlineJobFns()`** - Registers the Hugging Face Transformers local provider. Now you can use an ONNX model name for `TextEmbedding`, etc.
222
-
- **`register_TFMP_InlineJobFns()`** - Registers the MediaPipe TF.js local provider. Now you can use one of the MediaPipe models.
221
+
- **`newHuggingFaceTransformersProvider().register({ mode: "inline" })`** - Registers the Hugging Face Transformers local provider. Now you can use an ONNX model name for `TextEmbedding`, etc.
222
+
- **`newTensorFlowMediaPipeProvider().register({ mode: "inline" })`** - Registers the MediaPipe TF.js local provider. Now you can use one of the MediaPipe models.
223
223
224
224
### Registering Provider plus related Job Queue
225
225
226
-
LLM providers have long running functions. These are handled by a Job Queue. There are some pre-built ones:
226
+
LLM providers have long running functions. These are handled by a Job Queue. The `provider.register()` call creates the queue automatically. For convenience:
227
227
228
228
#### In memory:
229
229
230
-
- **`register_HFT_InMemoryQueue`** sets up the Hugging Face Transformers provider (above), and a job queue with `JobQueueServer` and `JobQueueClient` with a `ConcurrencyLimiter` so the ONNX queue only runs one task/job at a time.
231
-
- **`register_TFMP_InMemoryQueue`** does the same for MediaPipe.
0 commit comments