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.

ModelOptions.cs 2.8 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. using System.Text;
  2. using LLama.Abstractions;
  3. using LLama.Native;
  4. namespace LLama.Web.Common
  5. {
  6. public class ModelOptions
  7. : ILLamaParams
  8. {
  9. /// <summary>
  10. /// Model friendly name
  11. /// </summary>
  12. public string Name { get; set; }
  13. /// <summary>
  14. /// Max context insta=nces allowed per model
  15. /// </summary>
  16. public int MaxInstances { get; set; }
  17. /// <inheritdoc />
  18. public uint? ContextSize { get; set; }
  19. /// <inheritdoc />
  20. public int MainGpu { get; set; } = 0;
  21. /// <inheritdoc />
  22. public GPUSplitMode SplitMode { get; set; } = GPUSplitMode.None;
  23. /// <inheritdoc />
  24. public int GpuLayerCount { get; set; } = 20;
  25. /// <inheritdoc />
  26. public uint Seed { get; set; } = 1686349486;
  27. /// <inheritdoc />
  28. public bool UseMemorymap { get; set; } = true;
  29. /// <inheritdoc />
  30. public bool UseMemoryLock { get; set; } = false;
  31. /// <inheritdoc />
  32. public string ModelPath { get; set; }
  33. /// <inheritdoc />
  34. public AdapterCollection LoraAdapters { get; set; } = new();
  35. /// <inheritdoc />
  36. public string LoraBase { get; set; } = string.Empty;
  37. /// <inheritdoc />
  38. public uint? Threads { get; set; }
  39. /// <inheritdoc />
  40. public uint? BatchThreads { get; set; }
  41. /// <inheritdoc />
  42. public uint BatchSize { get; set; } = 512;
  43. /// <inheritdoc />
  44. public bool EmbeddingMode { get; set; } = false;
  45. /// <inheritdoc />
  46. public TensorSplitsCollection TensorSplits { get; set; } = new();
  47. /// <inheritdoc />
  48. public List<MetadataOverride> MetadataOverrides { get; } = new();
  49. /// <inheritdoc />
  50. public float? RopeFrequencyBase { get; set; }
  51. /// <inheritdoc />
  52. public float? RopeFrequencyScale { get; set; }
  53. /// <inheritdoc />
  54. public float? YarnExtrapolationFactor { get; set; }
  55. /// <inheritdoc />
  56. public float? YarnAttentionFactor { get; set; }
  57. /// <inheritdoc />
  58. public float? YarnBetaFast { get; set; }
  59. /// <inheritdoc />
  60. public float? YarnBetaSlow { get; set; }
  61. /// <inheritdoc />
  62. public uint? YarnOriginalContext { get; set; }
  63. /// <inheritdoc />
  64. public RopeScalingType? YarnScalingType { get; set; }
  65. /// <inheritdoc />
  66. public GGMLType? TypeK { get; set; }
  67. /// <inheritdoc />
  68. public GGMLType? TypeV { get; set; }
  69. /// <inheritdoc />
  70. public bool NoKqvOffload { get; set; }
  71. /// <inheritdoc />
  72. public Encoding Encoding { get; set; } = Encoding.UTF8;
  73. /// <inheritdoc />
  74. public bool VocabOnly { get; set; }
  75. }
  76. }