falcon-7B based sentence embedding
I would like to use falcon-7B to encode sentence/document to obtain text embedding using tool like sentence-transformer or huggingface embeddings (or text2vec), could I directly load falcon and use?
from sentence_transformers import SentenceTransformer, util
#model = SentenceTransformer('multi-qa-MiniLM-L6-cos-v1')
model = SentenceTransformer('tiiuae/falcon-7b')
query_embedding = model.encode('How big is London')
passage_embedding = model.encode(['London has 9,787,426 inhabitants at the 2011 census',
'London is known for its finacial district'])
print("Similarity:", util.dot_score(query_embedding, passage_embedding))
I don't believe Falcon can do embedding. It is a text generation model and not an embedding model.