Skip to content

Commit 29c2d23

Browse files
Joan Fontanalsalexcg1
andauthored
docs: add forward declaration steps to example to avoid pickling error (docarray#1615)
Signed-off-by: Joan Fontanals Martinez <joan.martinez@jina.ai> Signed-off-by: Joan Fontanals <jfontanalsmartinez@gmail.com> Co-authored-by: Alex Cureton-Griffiths <alexcg1@users.noreply.github.com>
1 parent 6903c77 commit 29c2d23

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

docs/how_to/multimodal_training_and_serving.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,18 @@ class PairTextImage(BaseDoc):
135135
image: ImageDoc
136136
```
137137

138+
You then need to forward declare the following types. This will allow the objects to be properly pickled and unpickled.
139+
140+
This will be unnecessary once [this issue](https://github.com/docarray/docarray/issues/1330) is resolved.
141+
142+
```python
143+
from docarray import DocVec
144+
DocVec[Tokens]
145+
DocVec[TextDoc]
146+
DocVec[ImageDoc]
147+
DocVec[PairTextImage]
148+
```
149+
138150
### Create the dataset
139151

140152
In this section we will create a multimodal pytorch dataset around the Flick8k dataset using DocArray.

0 commit comments

Comments
 (0)