Instructions to use modularStarEncoder/ModularStarEncoder with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use modularStarEncoder/ModularStarEncoder with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("feature-extraction", model="modularStarEncoder/ModularStarEncoder", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("modularStarEncoder/ModularStarEncoder", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
Upload ModularStarEncoder
Browse files153 unmodified lines154155156157158159160161153 unmodified linessuper().__init__()for element in dir(config):value = getattr(config, element) # Get the attribute valueif isinstance(value, tuple) or isinstance(value, list):setattr(config, element, value[-1])self.transform = StarEncoder2PredictionHeadTransform(config)# The output weights are the same as the input embeddings, but there is153 unmodified lines154155156157158159160161153 unmodified linessuper().__init__()for element in dir(config):value = getattr(config, element) # Get the attribute valueif (isinstance(value, tuple) or isinstance(value, list)) and len(value)>0:setattr(config, element, value[0])self.transform = StarEncoder2PredictionHeadTransform(config)# The output weights are the same as the input embeddings, but there is
modularStarEncoder.py+2-2