-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: shrink 17-artwork-multimodal import size #42
base: main
Are you sure you want to change the base?
Conversation
@@ -60,8 +60,8 @@ export function resizeImage( | |||
height: number | |||
} | |||
) { | |||
const { width, height } = defaults(options, { width: 500, height: 500 }) | |||
return `https://d7hftxdivxxvm.cloudfront.net/?src=${src}&resize_to=fit&width=${width}&height=${height}&grow=false` | |||
const { width, height } = defaults(options, { width: 224, height: 224 }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the default resolution configured in the CLIP
docs, so I have have copied that here. It is what has made the biggest difference.
@@ -114,6 +117,10 @@ async function prepareArtworkCollection() { | |||
name: "artistGender", | |||
dataType: ["text"], | |||
}, | |||
{ | |||
name: "isCurated", | |||
dataType: ["boolean"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@egdbear - decided to insert them into the same collection
with a flag.
memory usage still feels a bit high, but this gets us a stable instance and the ability to continue testing. |
export async function getArtworks(filename: string) { | ||
const filePath = path.join(__dirname, `./data/${filename}`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion: Maybe a filename could be optional here? Also this method is being used here.
This PR makes a few changes aimed at shrinking the size of the imports to
weaviate
. I have run a few batches with this configuration and the memory usage is much more in line with what we would expect to see:cc: @cavvia (not letting me add you as a reviewer...)