How to use FINGU-AI/Fingu-instruct-2 with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("FINGU-AI/Fingu-instruct-2", trust_remote_code=True) sentences = [ "Instruct: Given a web search query, retrieve relevant passages that answer the query.\nQuery: Glay", "The Theory of Good and Evil is a 1907 book about ethics by the English philosopher Hastings Rashdall, in which the author expounds a theory he calls \"ideal utilitarianism\". It has been seen as Rashdall's most important philosophical work.", "GLAY is a Japanese rock band , formed in Hakodate in 1988 . Glay primarily composes songs in the rock and pop genres , but they have also arranged songs using elements from a wide variety of genres , including punk , electronic , R&B , progressive rock , folk , reggae , gospel , and ska . Originally a visual kei band , the group slowly shifted to less dramatic attire through the years . As of 2008 , Glay had sold an estimated 51 million records ; 28 million singles and 23 million albums , making them one of the top ten best-selling artists of all time in Japan .", "Aashirwad is a 1968 Bollywood film , directed by Hrishikesh Mukherjee . The film stars Ashok Kumar and Sanjeev Kumar . The film is notable for its inclusion of a rap-like song performed by Ashok Kumar , `` Rail Gaadi '' ." ] embeddings = model.encode(sentences) similarities = model.similarity(embeddings, embeddings) print(similarities.shape) # [4, 4]
The community tab is the place to discuss and collaborate with the HF community!