How to use kamp0010/all-minilm-l6-v2-code with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("kamp0010/all-minilm-l6-v2-code") sentences = [ "Modify the inner parameters of the Kepler propagator in order to place\n the spacecraft in the right Sphere of Influence", "func (c *Conn) SetDeadline(t time.Time) error {\n\treturn c.p.SetDeadline(t)\n}", "def _change_soi(self, body):\n \n\n if body == self.central:\n self.bodies = [self.central]\n self.step = self.central_step\n self.active = self.central.name\n self.frame = self.central.name\n else:\n soi = self.SOI[body.name]\n self.bodies = [body]\n self.step = self.alt_step\n self.active = body.name\n self.frame = soi.frame", "def main(args=None):\n \"\"\"\"\"\"\n parser = _parser()\n\n # Python 2 will error 'too few arguments' if no subcommand is supplied.\n # No such error occurs in Python 3, which makes it feasible to check\n # whether a subcommand was provided (displaying a help message if not).\n # argparse internals vary significantly over the major versions, so it's\n # much easier to just override the args passed to it. In this case, print\n # the usage message if there are no args.\n if args is None and len(sys.argv) <= 1:\n sys.argv.append('--help')\n\n options = parser.parse_args(args)\n\n # pass options to subcommand\n options.func(options)\n\n return 0" ] embeddings = model.encode(sentences) similarities = model.similarity(embeddings, embeddings) print(similarities.shape) # [4, 4]
How to use kamp0010/all-minilm-l6-v2-code with Unsloth Studio:
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for kamp0010/all-minilm-l6-v2-code to start chatting
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for kamp0010/all-minilm-l6-v2-code to start chatting
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for kamp0010/all-minilm-l6-v2-code to start chatting
pip install unsloth from unsloth import FastModel model, tokenizer = FastModel.from_pretrained( model_name="kamp0010/all-minilm-l6-v2-code", max_seq_length=2048, )
The community tab is the place to discuss and collaborate with the HF community!