Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions docarray/documents/audio.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class AudioDoc(BaseDoc):

# use it directly
audio = AudioDoc(
url='https://github.com/docarray/docarray/blob/feat-rewrite-v2/tests/toydata/hello.wav?raw=true'
url='https://github.com/docarray/docarray/blob/main/tests/toydata/hello.wav?raw=true'
)
audio.tensor, audio.frame_rate = audio.url.load()
# model = MyEmbeddingModel()
Expand All @@ -59,7 +59,7 @@ class MyAudio(AudioDoc):


audio = MyAudio(
url='https://github.com/docarray/docarray/blob/feat-rewrite-v2/tests/toydata/hello.wav?raw=true'
url='https://github.com/docarray/docarray/blob/main/tests/toydata/hello.wav?raw=true'
)
audio.name = TextDoc(text='my first audio')
audio.tensor, audio.frame_rate = audio.url.load()
Expand All @@ -82,7 +82,7 @@ class MultiModalDoc(BaseDoc):

mmdoc = MultiModalDoc(
audio=AudioDoc(
url='https://github.com/docarray/docarray/blob/feat-rewrite-v2/tests/toydata/hello.wav?raw=true'
url='https://github.com/docarray/docarray/blob/main/tests/toydata/hello.wav?raw=true'
),
text=TextDoc(text='hello world, how are you doing?'),
)
Expand Down
6 changes: 3 additions & 3 deletions docarray/documents/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class ImageDoc(BaseDoc):

# use it directly
image = ImageDoc(
url='https://github.com/docarray/docarray/blob/feat-rewrite-v2/tests/toydata/image-data/apple.png?raw=true'
url='https://github.com/docarray/docarray/blob/main/tests/toydata/image-data/apple.png?raw=true'
)
image.tensor = image.url.load()
# model = MyEmbeddingModel()
Expand All @@ -57,7 +57,7 @@ class MyImage(ImageDoc):


image = MyImage(
url='https://github.com/docarray/docarray/blob/feat-rewrite-v2/tests/toydata/image-data/apple.png?raw=true'
url='https://github.com/docarray/docarray/blob/main/tests/toydata/image-data/apple.png?raw=true'
)
image.tensor = image.url.load()
# model = MyEmbeddingModel()
Expand All @@ -80,7 +80,7 @@ class MultiModalDoc(BaseDoc):

mmdoc = MultiModalDoc(
image=ImageDoc(
url='https://github.com/docarray/docarray/blob/feat-rewrite-v2/tests/toydata/image-data/apple.png?raw=true'
url='https://github.com/docarray/docarray/blob/main/tests/toydata/image-data/apple.png?raw=true'
),
text=TextDoc(text='hello world, how are you doing?'),
)
Expand Down
2 changes: 1 addition & 1 deletion docarray/documents/text.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ class MultiModalDoc(BaseDoc):

mmdoc = MultiModalDoc(
image_doc=ImageDoc(
url='https://github.com/docarray/docarray/blob/feat-rewrite-v2/tests/toydata/image-data/apple.png?raw=true'
url='https://github.com/docarray/docarray/blob/main/tests/toydata/image-data/apple.png?raw=true'
),
text_doc=TextDoc(text='hello world, how are you doing?'),
)
Expand Down
6 changes: 3 additions & 3 deletions docarray/documents/video.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class VideoDoc(BaseDoc):

# use it directly
vid = VideoDoc(
url='https://github.com/docarray/docarray/blob/feat-rewrite-v2/tests/toydata/mov_bbb.mp4?raw=true'
url='https://github.com/docarray/docarray/blob/main/tests/toydata/mov_bbb.mp4?raw=true'
)
vid.tensor, vid.audio.tensor, vid.key_frame_indices = vid.url.load()
# model = MyEmbeddingModel()
Expand All @@ -62,7 +62,7 @@ class MyVideo(VideoDoc):


video = MyVideo(
url='https://github.com/docarray/docarray/blob/feat-rewrite-v2/tests/toydata/mov_bbb.mp4?raw=true'
url='https://github.com/docarray/docarray/blob/main/tests/toydata/mov_bbb.mp4?raw=true'
)
video.name = TextDoc(text='my first video')
video.tensor = video.url.load().video
Expand All @@ -85,7 +85,7 @@ class MultiModalDoc(BaseDoc):

mmdoc = MultiModalDoc(
video=VideoDoc(
url='https://github.com/docarray/docarray/blob/feat-rewrite-v2/tests/toydata/mov_bbb.mp4?raw=true'
url='https://github.com/docarray/docarray/blob/main/tests/toydata/mov_bbb.mp4?raw=true'
),
text=TextDoc(text='hello world, how are you doing?'),
)
Expand Down
2 changes: 1 addition & 1 deletion docarray/typing/bytes/video_bytes.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class MyDoc(BaseDoc):


doc = MyDoc(
video_url='https://github.com/docarray/docarray/blob/feat-rewrite-v2/tests/toydata/mov_bbb.mp4?raw=true'
video_url='https://github.com/docarray/docarray/blob/main/tests/toydata/mov_bbb.mp4?raw=true'
)

video, audio, key_frame_indices = doc.video_url.load()
Expand Down
2 changes: 1 addition & 1 deletion docarray/typing/tensor/video/video_ndarray.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class MyVideoDoc(BaseDoc):

doc_2 = MyVideoDoc(
title='my_second_video_doc',
url='https://github.com/docarray/docarray/blob/feat-rewrite-v2/tests/toydata/mov_bbb.mp4?raw=true',
url='https://github.com/docarray/docarray/blob/main/tests/toydata/mov_bbb.mp4?raw=true',
)

doc_2.video_tensor = parse_obj_as(VideoNdArray, doc_2.url.load().video)
Expand Down
2 changes: 1 addition & 1 deletion docarray/typing/tensor/video/video_tensorflow_tensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class MyVideoDoc(BaseDoc):

doc_2 = MyVideoDoc(
title='my_second_video_doc',
url='https://github.com/docarray/docarray/blob/feat-rewrite-v2/tests/toydata/mov_bbb.mp4?raw=true',
url='https://github.com/docarray/docarray/blob/main/tests/toydata/mov_bbb.mp4?raw=true',
)

doc_2.video_tensor = doc_2.url.load().video
Expand Down
2 changes: 1 addition & 1 deletion docarray/typing/tensor/video/video_torch_tensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class MyVideoDoc(BaseDoc):

doc_2 = MyVideoDoc(
title='my_second_video_doc',
url='https://github.com/docarray/docarray/blob/feat-rewrite-v2/tests/toydata/mov_bbb.mp4?raw=true',
url='https://github.com/docarray/docarray/blob/main/tests/toydata/mov_bbb.mp4?raw=true',
)

doc_2.video_tensor = doc_2.url.load().video
Expand Down
4 changes: 2 additions & 2 deletions docarray/typing/url/video_url.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class MyDoc(BaseDoc):


doc = MyDoc(
video_url='https://github.com/docarray/docarray/blob/feat-rewrite-v2/tests/toydata/mov_bbb.mp4?raw=true'
video_url='https://github.com/docarray/docarray/blob/main/tests/toydata/mov_bbb.mp4?raw=true'
)
doc.video, doc.audio, doc.key_frame_indices = doc.video_url.load()

Expand All @@ -64,7 +64,7 @@ class MyDoc(BaseDoc):

url = parse_obj_as(
VideoUrl,
'https://github.com/docarray/docarray/blob/feat-rewrite-v2/tests/toydata/mov_bbb.mp4?raw=true',
'https://github.com/docarray/docarray/blob/main/tests/toydata/mov_bbb.mp4?raw=true',
)
key_frame_indices = url.load().key_frame_indices
assert isinstance(key_frame_indices, NdArray)
Expand Down
10 changes: 5 additions & 5 deletions docs/data_types/audio/audio.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class MyAudio(BaseDoc):


doc = MyAudio(
url='https://github.com/docarray/docarray/blob/feat-rewrite-v2/tests/toydata/hello.mp3?raw=true'
url='https://github.com/docarray/docarray/blob/main/tests/toydata/hello.mp3?raw=true'
)
```

Expand All @@ -64,7 +64,7 @@ doc.summary()
╭──────────────────────┬───────────────────────────────────────────────────────╮
│ Attribute │ Value │
├──────────────────────┼───────────────────────────────────────────────────────┤
│ url: AudioUrl │ https://github.com/docarray/docarray/blob/feat-rew
│ url: AudioUrl │ https://github.com/docarray/docarray/blob/main/tes
│ │ ... (length: 90) │
│ tensor: AudioNdArray │ AudioNdArray of shape (30833,), dtype: float64 │
│ frame_rate: int │ 44100 │
Expand Down Expand Up @@ -95,7 +95,7 @@ class MyAudio(BaseDoc):


doc = MyAudio(
url='https://github.com/docarray/docarray/blob/feat-rewrite-v2/tests/toydata/hello.mp3?raw=true'
url='https://github.com/docarray/docarray/blob/main/tests/toydata/hello.mp3?raw=true'
)

doc.tf_tensor, _ = doc.url.load()
Expand Down Expand Up @@ -123,7 +123,7 @@ class MyAudio(BaseDoc):


doc = MyAudio(
url='https://github.com/docarray/docarray/blob/feat-rewrite-v2/tests/toydata/hello.mp3?raw=true'
url='https://github.com/docarray/docarray/blob/main/tests/toydata/hello.mp3?raw=true'
)

doc.bytes_ = doc.url.load_bytes() # type(doc.bytes_) = AudioBytes
Expand Down Expand Up @@ -203,7 +203,7 @@ class MyAudio(AudioDoc):


audio = MyAudio(
url='https://github.com/docarray/docarray/blob/feat-rewrite-v2/tests/toydata/hello.mp3?raw=true'
url='https://github.com/docarray/docarray/blob/main/tests/toydata/hello.mp3?raw=true'
)
audio.name = 'My first audio doc!'
audio.tensor, audio.frame_rate = audio.url.load()
Expand Down
8 changes: 4 additions & 4 deletions docs/data_types/image/image.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class MyImage(BaseDoc):


img = MyImage(
url='https://github.com/docarray/docarray/blob/feat-rewrite-v2/tests/toydata/image-data/apple.png?raw=true'
url='https://github.com/docarray/docarray/blob/main/tests/toydata/image-data/apple.png?raw=true'
)
```

Expand Down Expand Up @@ -66,7 +66,7 @@ class MyImage(BaseDoc):
torch_tensor: ImageTorchTensor = None


img = MyImage(url='https://github.com/docarray/docarray/blob/feat-rewrite-v2/tests/toydata/image-data/apple.png?raw=true')
img = MyImage(url='https://github.com/docarray/docarray/blob/main/tests/toydata/image-data/apple.png?raw=true')
img.tf_tensor = img.url.load()
img.torch_tensor = img.url.load()

Expand All @@ -80,7 +80,7 @@ You can also load the URL content as a [`PIL.Image.Image`](https://pillow.readth
from PIL.Image import Image as PILImage

img = MyImage(
url='https://github.com/docarray/docarray/blob/feat-rewrite-v2/tests/toydata/image-data/apple.png?raw=true'
url='https://github.com/docarray/docarray/blob/main/tests/toydata/image-data/apple.png?raw=true'
)
pil_img = img.url.load_pil()

Expand Down Expand Up @@ -141,7 +141,7 @@ class MyImage(BaseDoc):
tensor: ImageTensor = None


img = MyImage(url='https://github.com/docarray/docarray/blob/feat-rewrite-v2/tests/toydata/image-data/apple.png?raw=true')
img = MyImage(url='https://github.com/docarray/docarray/blob/main/tests/toydata/image-data/apple.png?raw=true')

img.bytes_ = img.url.load_bytes() # type(img.bytes_) = ImageBytes
img.tensor = img.bytes_.load() # type(img.tensor) = ImageNdarray
Expand Down
14 changes: 7 additions & 7 deletions docs/data_types/multimodal/multimodal.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ data.
```python
page = Page(
main_text='Hello world',
img_url='https://github.com/docarray/docarray/blob/feat-rewrite-v2/docs/assets/favicon.png?raw=true',
img_url='https://github.com/docarray/docarray/blob/main/docs/assets/favicon.png?raw=true',
img_description='This is the image of an apple',
)
page.img_tensor = page.img_url.load()
Expand All @@ -52,7 +52,7 @@ page.summary()
│ Attribute │ Value │
├──────────────────────────────┼───────────────────────────────────────────────┤
│ main_text: str │ Hello world │
│ img_url: ImageUrl │ https://github.com/docarray/docarray/blob/fe… │
│ img_url: ImageUrl │ https://github.com/docarray/docarray/blob/ma… │
│ │ ... (length: 90) │
│ img_description: str │ This is DocArray │
│ img_tensor: ImageTorchTensor │ ImageTorchTensor of shape (320, 320, 3), │
Expand All @@ -75,7 +75,7 @@ print(page.img_tensor)
<summary>Output</summary>
``` { .text .no-copy }
Hello world
https://github.com/docarray/docarray/blob/feat-rewrite-v2/docs/assets/favicon.png?raw=true
https://github.com/docarray/docarray/blob/main/docs/assets/favicon.png?raw=true
This is DocArray
ImageTorchTensor([[[0, 0, 0],
[0, 0, 0],
Expand Down Expand Up @@ -119,14 +119,14 @@ You can instantiate this more complex `Newspaper` object in the same way as befo
```python
cover_page = Page(
main_text='DocArray Daily',
img_url='https://github.com/docarray/docarray/blob/feat-rewrite-v2/docs/assets/favicon.png',
img_url='https://github.com/docarray/docarray/blob/main/docs/assets/favicon.png',
)

pages = DocList[Page](
[
Page(
main_text='Hello world',
img_url='https://github.com/docarray/docarray/blob/feat-rewrite-v2/docs/assets/favicon.png',
img_url='https://github.com/docarray/docarray/blob/main/docs/assets/favicon.png',
img_description='This is the image of an apple',
),
Page(main_text='Second page'),
Expand Down Expand Up @@ -158,7 +158,7 @@ docarray_daily.summary()
│ │ Attribute │ Value │
│ ├───────────────────┼──────────────────────────────────────────────────┤
│ │ main_text: str │ DocArray Daily │
│ │ img_url: ImageUrl │ https://github.com/docarray/docarray/blob/feat-… │
│ │ img_url: ImageUrl │ https://github.com/docarray/docarray/blob/main/… │
│ │ │ ... (length: 81) │
│ ╰───────────────────┴──────────────────────────────────────────────────╯
└── 💠 pages: DocList[Page]
Expand All @@ -167,7 +167,7 @@ docarray_daily.summary()
│ │ Attribute │ Value │
│ ├──────────────────────┼───────────────────────────────────────────────┤
│ │ main_text: str │ Hello world │
│ │ img_url: ImageUrl │ https://github.com/docarray/docarray/blob/fe… │
│ │ img_url: ImageUrl │ https://github.com/docarray/docarray/blob/ma… │
│ │ │ ... (length: 81) │
│ │ img_description: str │ DocArray logoooo │
│ ╰──────────────────────┴───────────────────────────────────────────────╯
Expand Down
6 changes: 3 additions & 3 deletions docs/data_types/table/table.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ from docarray import DocList


docs = DocList[Book].from_csv(
file_path='https://github.com/docarray/docarray/blob/feat-rewrite-v2/tests/toydata/books.csv?raw=true'
file_path='https://github.com/docarray/docarray/blob/main/tests/toydata/books.csv?raw=true'
)
docs.summary()
```
Expand Down Expand Up @@ -136,7 +136,7 @@ Title2 author2 1234

```python
docs = DocList[Book].from_csv(
file_path='https://github.com/docarray/docarray/blob/feat-rewrite-v2/tests/toydata/books.tsv?raw=true',
file_path='https://github.com/docarray/docarray/blob/main/tests/toydata/books.tsv?raw=true',
dialect='excel-tab',
)
for doc in docs:
Expand Down Expand Up @@ -194,7 +194,7 @@ class SemicolonSeparator(csv.Dialect):
Finally, you can load your data by setting the `dialect` parameter in [`.from_csv()`][docarray.array.doc_list.io.IOMixinArray.from_csv] to an instance of your `SemicolonSeparator`.
```python
docs = DocList[Book].from_csv(
file_path='https://github.com/docarray/docarray/blob/feat-rewrite-v2/tests/toydata/books_semicolon_sep.csv?raw=true',
file_path='https://github.com/docarray/docarray/blob/main/tests/toydata/books_semicolon_sep.csv?raw=true',
dialect=SemicolonSeparator(),
)
for doc in docs:
Expand Down
8 changes: 4 additions & 4 deletions docs/data_types/video/video.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class MyVideo(BaseDoc):


doc = MyVideo(
url='https://github.com/docarray/docarray/blob/feat-rewrite-v2/tests/toydata/mov_bbb.mp4?raw=true'
url='https://github.com/docarray/docarray/blob/main/tests/toydata/mov_bbb.mp4?raw=true'
)
```

Expand Down Expand Up @@ -88,7 +88,7 @@ class MyVideo(BaseDoc):


doc = MyVideo(
url='https://github.com/docarray/docarray/blob/feat-rewrite-v2/tests/toydata/mov_bbb.mp4?raw=true'
url='https://github.com/docarray/docarray/blob/main/tests/toydata/mov_bbb.mp4?raw=true'
)

doc.tf_tensor = doc.url.load().video
Expand Down Expand Up @@ -116,7 +116,7 @@ class MyVideo(BaseDoc):


doc = MyVideo(
url='https://github.com/docarray/docarray/blob/feat-rewrite-v2/tests/toydata/mov_bbb.mp4?raw=true'
url='https://github.com/docarray/docarray/blob/main/tests/toydata/mov_bbb.mp4?raw=true'
)

doc.bytes_ = doc.url.load_bytes()
Expand Down Expand Up @@ -216,7 +216,7 @@ class MyVideo(VideoDoc):


video = MyVideo(
url='https://github.com/docarray/docarray/blob/feat-rewrite-v2/tests/toydata/mov_bbb.mp4?raw=true'
url='https://github.com/docarray/docarray/blob/main/tests/toydata/mov_bbb.mp4?raw=true'
)
video.name = 'My first video doc!'
video.tensor = video.url.load().video
Expand Down
Loading