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.

RuntimeError.cs 837 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. using System;
  2. namespace LLama.Exceptions;
  3. /// <summary>
  4. /// Base class for LLamaSharp runtime errors (i.e. errors produced by llama.cpp, converted into exceptions)
  5. /// </summary>
  6. public class RuntimeError
  7. : Exception
  8. {
  9. /// <summary>
  10. /// Create a new RuntimeError
  11. /// </summary>
  12. /// <param name="message"></param>
  13. public RuntimeError(string message)
  14. : base(message)
  15. {
  16. }
  17. }
  18. /// <summary>
  19. /// Loading model weights failed
  20. /// </summary>
  21. public class LoadWeightsFailedException
  22. : RuntimeError
  23. {
  24. /// <summary>
  25. /// The model path which failed to load
  26. /// </summary>
  27. public string ModelPath { get; }
  28. /// <inheritdoc />
  29. public LoadWeightsFailedException(string modelPath)
  30. : base($"Failed to load model '{modelPath}'")
  31. {
  32. ModelPath = modelPath;
  33. }
  34. }