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.

llama.llamaembedder.md 1.4 kB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. # LLamaEmbedder
  2. Namespace: LLama
  3. The embedder for LLama, which supports getting embeddings from text.
  4. ```csharp
  5. public class LLamaEmbedder : System.IDisposable
  6. ```
  7. Inheritance [Object](https://docs.microsoft.com/en-us/dotnet/api/system.object) → [LLamaEmbedder](./llama.llamaembedder.md)<br>
  8. Implements [IDisposable](https://docs.microsoft.com/en-us/dotnet/api/system.idisposable)
  9. ## Constructors
  10. ### **LLamaEmbedder(ModelParams)**
  11. ```csharp
  12. public LLamaEmbedder(ModelParams params)
  13. ```
  14. #### Parameters
  15. `params` [ModelParams](./llama.common.modelparams.md)<br>
  16. ## Methods
  17. ### **GetEmbeddings(String, Int32, Boolean, String)**
  18. Get the embeddings of the text.
  19. ```csharp
  20. public Single[] GetEmbeddings(string text, int threads, bool addBos, string encoding)
  21. ```
  22. #### Parameters
  23. `text` [String](https://docs.microsoft.com/en-us/dotnet/api/system.string)<br>
  24. `threads` [Int32](https://docs.microsoft.com/en-us/dotnet/api/system.int32)<br>
  25. Threads used for inference.
  26. `addBos` [Boolean](https://docs.microsoft.com/en-us/dotnet/api/system.boolean)<br>
  27. Add bos to the text.
  28. `encoding` [String](https://docs.microsoft.com/en-us/dotnet/api/system.string)<br>
  29. #### Returns
  30. [Single[]](https://docs.microsoft.com/en-us/dotnet/api/system.single)<br>
  31. #### Exceptions
  32. [RuntimeError](./llama.exceptions.runtimeerror.md)<br>
  33. ### **Dispose()**
  34. ```csharp
  35. public void Dispose()
  36. ```

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