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

test: Add model load test below n param threshold #1698

Draft
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

isaac-chung
Copy link
Collaborator

@isaac-chung isaac-chung commented Jan 3, 2025

Fixes #1690

  • first get the model meta from model registry and check for n_parameters, and omit API models.
  • if it is below threshold (2B for now), then run mteb.get_model and output the exception (None or raw text)
  • write these to a cache folder in repo
  • continue running from where the script left off
  • cache folder invalidated based on a hash of the the model implementation (or model file)

Checklist

  • Run tests locally to make sure nothing is broken using make test.
  • Run the formatter to format the code using make lint.

@isaac-chung isaac-chung marked this pull request as draft January 3, 2025 08:56
@Samoed
Copy link
Collaborator

Samoed commented Jan 3, 2025

I think we could create a file to record whether a model load was successful, to avoid repeated loading attempts.

@isaac-chung
Copy link
Collaborator Author

Right now the main issue is disk running out of space. Looking into how not to save the weights into cache folder when loading a model.

@Samoed
Copy link
Collaborator

Samoed commented Jan 4, 2025

Also, test should skip API based models

"colbert-ir/colbertv2.0": "To use the ColBERT models `pylate` is required. Please install it with `pip install mteb[pylate]`.",
"google/flan-t5-large": null,
"intfloat/e5-mistral-7b-instruct": "Over threshold. Not tested.",
"intfloat/multilingual-e5-large-instruct": "XLMRobertaModel.__init__() got an unexpected keyword argument 'cache_folder'",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems that cache_folder=CACHE_FOLDER breaks loading. Maybe use default HF cache folder with scan_cache_dir().delete_revisions? https://huggingface.co/docs/huggingface_hub/en/guides/manage-cache#clean-cache-from-python

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will give it a try.

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.

Unittests to check model loading?
2 participants