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.

Index.cshtml.cs 1.2 kB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. using LLama.Web.Common;
  2. using Microsoft.AspNetCore.Mvc;
  3. using Microsoft.AspNetCore.Mvc.RazorPages;
  4. using Microsoft.Extensions.Options;
  5. namespace LLama.Web.Pages
  6. {
  7. public class IndexModel : PageModel
  8. {
  9. private readonly ILogger<IndexModel> _logger;
  10. public IndexModel(ILogger<IndexModel> logger, IOptions<LLamaOptions> options)
  11. {
  12. _logger = logger;
  13. Options = options.Value;
  14. }
  15. public LLamaOptions Options { get; set; }
  16. [BindProperty]
  17. public Common.SessionOptions SessionOptions { get; set; }
  18. [BindProperty]
  19. public InferenceOptions InferenceOptions { get; set; }
  20. public void OnGet()
  21. {
  22. SessionOptions = new Common.SessionOptions
  23. {
  24. Prompt = "Below is an instruction that describes a task. Write a response that appropriately completes the request.",
  25. AntiPrompt = "User:",
  26. // OutputFilter = "User:, Response:"
  27. };
  28. InferenceOptions = new InferenceOptions
  29. {
  30. Temperature = 0.8f
  31. };
  32. }
  33. }
  34. }