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.cs 509 B

12345678910111213141516171819202122
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. namespace LLama.Examples
  7. {
  8. public class GetEmbeddings
  9. {
  10. LLamaEmbedder _embedder;
  11. public GetEmbeddings(string modelPath)
  12. {
  13. _embedder = new LLamaEmbedder(new LLamaParams(model: modelPath));
  14. }
  15. public void Run(string text)
  16. {
  17. Console.WriteLine(string.Join(", ", _embedder.GetEmbeddings(text)));
  18. }
  19. }
  20. }

C#/.NET上易用的LLM高性能推理框架,支持LLaMA和LLaVA系列模型。