-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
da28054
commit 11425fa
Showing
1 changed file
with
20 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import pandas as pd | ||
from torchvision import datasets | ||
import lotus | ||
from lotus.models import LM | ||
from lotus.dtype_extensions import ImageArray | ||
|
||
lm = LM(model="gpt-4o-mini") | ||
lotus.settings.configure(lm=lm) | ||
|
||
mnist_data = datasets.MNIST(root='mnist_data', train=True, download=True, transform=None) | ||
|
||
images = [image for image, _ in mnist_data] | ||
labels = [label for _, label in mnist_data] | ||
|
||
df = pd.DataFrame({ | ||
"image": ImageArray(images), | ||
"label": labels | ||
}) | ||
|
||
df.sem_filter("{image} represents number 1") |