How to use deebak14/embedding_gemma_ft_v1 with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("deebak14/embedding_gemma_ft_v1") sentences = [ "I need to lock an object in my model so I can work on other parts without accidentally selecting it. How can I do that?", "You cannot use the following methods IsObjectLocked, LockObjects, UnlockObject, SelectObject, SelectObjects, UnlockObjects, IsObjectSelectable, ShowObject, IsObjectNormal", "object", "You can use the following methods to complete the task.\nmethod: LockObject\ndescription: Locks a single object. Locked objects are visible, and they can be\r\n snapped to. But, they cannot be selected.\nsyntax: LockObject(object_id)\nparameters: object_id (guid): The identifier of an object\nreturns: bool: True or False indicating success or failure\n\nFollowing is the code that uses this method to complete the task as per user query.\n\n```python\nimport rhinoscriptsyntax as rs\n\n# Lock an object in the model to prevent accidental selection\nid = rs.GetObject(\"Select object to lock\")\nif id:\n rs.LockObject(id)\n print(\"Object locked successfully.\")\nelse:\n print(\"No object selected.\")\n```" ] 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!