[ENHANCEMENT] Pydantic Class for Add Docs with Device
vicilliar opened this issue · 0 comments
vicilliar commented
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
- We should create a new Pydantic Class like
AddDocsParamsWithDevice
which is a subclass ofAddDocsParams
wheredevice
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 - Redundant validation for device in
add_documents_orchestrator
should be removed. Instead, it will convert the input instance ofAddDocsParams
into an instance ofAddDocsParamsWithDeivce
to pass to lower level functions. add_documents
,_batch_request
,add_documents_mp
should takeAddDocsParamsWithDevice
as a parameter instead ofAddDocsParams
.