marqo-ai/marqo

[ENHANCEMENT] Pydantic Class for Add Docs with Device

vicilliar opened this issue · 0 comments

Is your feature request related to a problem? Please describe.
Improves validation for AddDocsParams (to ensure device is not None).

Describe the solution you'd like

  1. We should create a new Pydantic Class like AddDocsParamsWithDevice which is a subclass of AddDocsParams where device cannot be none. Initial work for this done: https://github.com/marqo-ai/marqo/blob/joshua/cuda-default-device/src/marqo/tensor_search/models/add_docs_objects.py#L51
  2. Redundant validation for device in add_documents_orchestrator should be removed. Instead, it will convert the input instance of AddDocsParams into an instance of AddDocsParamsWithDeivce to pass to lower level functions.
  3. add_documents , _batch_request , add_documents_mp should take AddDocsParamsWithDevice as a parameter instead of AddDocsParams.