Feature Extraction
sentence-transformers
PyTorch
Transformers
English
Chinese
xlm-roberta
sentence-similarity
text-embeddings-inference
Instructions to use maidalun1020/bce-embedding-base_v1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use maidalun1020/bce-embedding-base_v1 with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("maidalun1020/bce-embedding-base_v1") sentences = [ "The weather is lovely today.", "It's so sunny outside!", "He drove to the stadium." ] embeddings = model.encode(sentences) similarities = model.similarity(embeddings, embeddings) print(similarities.shape) # [3, 3] - Transformers
How to use maidalun1020/bce-embedding-base_v1 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("feature-extraction", model="maidalun1020/bce-embedding-base_v1")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModel tokenizer = AutoTokenizer.from_pretrained("maidalun1020/bce-embedding-base_v1") model = AutoModel.from_pretrained("maidalun1020/bce-embedding-base_v1", device_map="auto") - Inference
- Notebooks
- Google Colab
- Kaggle
为什么修改1_Pooling/config.json中配置word_embedding_dimension=128,但无法生效
#13
by sungangwudi - opened
为什么修改1_Pooling/config.json中配置word_embedding_dimension=128,但无法生效
you can not change its dimension by this way.
maidalun1020 changed discussion status to closed
thank you for your response.
I wonder how to change its dimension?
e.g. you can change the projection head by a linear layer with your dimension, and then train the model with total train data.
NOTE: a. "embedding" should be the projection head output. b. there could be a risk that model could perform worse after you train the model.