Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 35d2138

Browse filesBrowse files
authored
docs: adding field descriptions to predefined audio document (#1774)
Signed-off-by: punndcoder28 <puneethk.2899@gmail.com>
1 parent 715252a commit 35d2138
Copy full SHA for 35d2138

1 file changed

+25-5Lines changed: 25 additions & 5 deletions

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎docarray/documents/audio.py‎

Copy file name to clipboardExpand all lines: docarray/documents/audio.py
+25-5Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
import numpy as np
44

5+
from pydantic import Field
6+
57
from docarray.base_doc import BaseDoc
68
from docarray.typing import AnyEmbedding, AudioUrl
79
from docarray.typing.bytes.audio_bytes import AudioBytes
@@ -94,11 +96,29 @@ class MultiModalDoc(BaseDoc):
9496
```
9597
"""
9698

97-
url: Optional[AudioUrl] = None
98-
tensor: Optional[AudioTensor] = None
99-
embedding: Optional[AnyEmbedding] = None
100-
bytes_: Optional[AudioBytes] = None
101-
frame_rate: Optional[int] = None
99+
url: Optional[AudioUrl] = Field(
100+
description='The url to a (potentially remote) audio file that can be loaded',
101+
example='https://github.com/docarray/docarray/blob/main/tests/toydata/hello.mp3?raw=true',
102+
default=None,
103+
)
104+
tensor: Optional[AudioTensor] = Field(
105+
description='Tensor object of the audio which can be specified to one of `AudioNdArray`, `AudioTorchTensor`, `AudioTensorFlowTensor`',
106+
default=None,
107+
)
108+
embedding: Optional[AnyEmbedding] = Field(
109+
description='Store an embedding: a vector representation of the audio.',
110+
example=[0, 1, 0],
111+
default=None,
112+
)
113+
bytes_: Optional[AudioBytes] = Field(
114+
description='Bytes representation pf the audio',
115+
default=None,
116+
)
117+
frame_rate: Optional[int] = Field(
118+
description='An integer representing the frame rate of the audio.',
119+
example=24,
120+
default=None,
121+
)
102122

103123
@classmethod
104124
def validate(

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.