Skip to content
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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mc-jones
Copy link
Contributor

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:

Screenshot 2024-11-13 at 5 31 54 PM

cc: @cavvia (not letting me add you as a reviewer...)

@@ -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 })
Copy link
Contributor Author

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"],
Copy link
Contributor Author

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.

@mc-jones
Copy link
Contributor Author

memory usage still feels a bit high, but this gets us a stable instance and the ability to continue testing.

Comment on lines +14 to +15
export async function getArtworks(filename: string) {
const filePath = path.join(__dirname, `./data/${filename}`)
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants