You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

GetEmbeddings.md 550 B

12345678910111213
  1. # Get embeddings
  2. Getting the embeddings of a text in LLM is sometimes useful, for example, to train other MLP models.
  3. To get the embeddings, please initialize a `LLamaEmbedder` and then call `GetEmbeddings`.
  4. ```cs
  5. var embedder = new LLamaEmbedder(new ModelParams("<modelPath>"));
  6. string text = "hello, LLM.";
  7. float[] embeddings = embedder.GetEmbeddings(text);
  8. ```
  9. The output is a float array. Note that the length of the array is related with the model you load. If you just want to get a smaller size embedding, please consider changing a model.