-
Notifications
You must be signed in to change notification settings - Fork 410
Expand file tree
/
Copy pathdatachain.yml
More file actions
41 lines (32 loc) 路 1.44 KB
/
Copy pathdatachain.yml
File metadata and controls
41 lines (32 loc) 路 1.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
- title: Filter a billion samples in seconds
description:
Datasets are getting larger, but the ability to iterate rapidly and
efficiently is as important as ever.
terminal: |
from datachain.query import C, DatasetQuery
from datachain.lib.webdataset import WebDataset
from datachain.lib.gpt4_vision import DescribeImage
prompt = "How many people in the image?"
people = DataChain.from_storage("s3://my-storage/", type="image") \
.filter(C.name.glob("*.jpg")) \
.map(DescribeImage(prompt, max_token = 300)) \
.mutate(num_people = int(C.descr))
people.filter(C.num_people > 3)
- title: Create datasets from queries
description:
Save the results of a query in a dataset that you can use to train your ML
models.
terminal: |
from datachain.lib.dc import C, DataChain
images = DataChain.from_storage("s3://my-storage/", type="image") \
.filter(C.name.glob("*.jpg"))
images.save("fashion-product-images")
- title: Version datasets without copying data
description:
No expensive data copies, hash calculations, or data movement. Capture and
save metadata instead of data.
terminal: |
from datachain.lib.dc import C, DataChain
images = DataChain.from_storage("s3://my-storage/", type="image") \
.filter(C.name.glob("*.jpg"))
images.save("fashion-product-images")