Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save kacperlukawski/7db2135b24ab8abebe06519b55e072d1 to your computer and use it in GitHub Desktop.
Save kacperlukawski/7db2135b24ab8abebe06519b55e072d1 to your computer and use it in GitHub Desktop.
from sklearn.pipeline import make_pipeline
from embetter.grab import ColumnGrabber
from embetter.vision import ImageLoader, TimmEncoder
from embetter.text import SentenceEncoder
output_directory = Path("./images")
image_pipeline = make_pipeline(
ColumnGrabber("URL"),
DownloadFile(output_directory),
ImageLoader(),
TimmEncoder("vit_base_patch16_224"),
)
text_pipeline = make_pipeline(
ColumnGrabber("TEXT"),
SentenceEncoder("all-MiniLM-L6-v2"),
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment