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 5.7 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. @page
  2. @using LLama.Web.Common;
  3. @model IndexModel
  4. @{
  5. ViewData["Title"] = "Inference Demo";
  6. }
  7. @Html.AntiForgeryToken()
  8. <div class="d-flex flex-row h-100 pt-1 pb-1">
  9. <div class="d-flex flex-column h-100 border me-1 w-25">
  10. <div class="d-flex flex-row justify-content-between border-bottom p-1 align-items-center">
  11. <div>
  12. <span>@ViewData["Title"]</span>
  13. </div>
  14. <div>
  15. <small>Socket: <b id="socket">Disconnected</b></small>
  16. </div>
  17. </div>
  18. <div class="d-flex flex-column overflow-auto">
  19. <form id="SessionParameters">
  20. <div class="d-flex flex-column m-1">
  21. <div class="d-flex flex-column mb-2">
  22. <small>Model</small>
  23. @Html.DropDownListFor(m => m.SessionConfig.Model, new SelectList(Model.Options.Models, "Name", "Name"), new { @class = "form-control prompt-control" ,required="required", autocomplete="off"})
  24. </div>
  25. <div class="d-flex flex-column mb-2">
  26. <small>Inference Type</small>
  27. @Html.DropDownListFor(m => m.SessionConfig.ExecutorType, Html.GetEnumSelectList<LLamaExecutorType>(), new { @class = "form-control prompt-control" ,required="required", autocomplete="off"})
  28. </div>
  29. <nav>
  30. <div class="nav nav-tabs" id="nav-tab" role="tablist">
  31. <button class="nav-link active w-50" id="nav-prompt-tab" data-bs-toggle="tab" data-bs-target="#nav-prompt" type="button" role="tab">Prompt</button>
  32. <button class="nav-link w-50" id="nav-params-tab" data-bs-toggle="tab" data-bs-target="#nav-params" type="button" role="tab">Parameters</button>
  33. </div>
  34. </nav>
  35. <div class="tab-content" id="nav-tabContent">
  36. <div class="tab-pane fade show active" id="nav-prompt" role="tabpanel" aria-labelledby="nav-prompt-tab">
  37. <div class="d-flex flex-column mb-2">
  38. <small>Prompt</small>
  39. @Html.TextAreaFor(m => Model.SessionConfig.Prompt, new { @type="text", @class = "form-control prompt-control", rows=8})
  40. </div>
  41. <div class="d-flex flex-column mb-2">
  42. <small>AntiPrompts</small>
  43. @Html.TextBoxFor(m => Model.SessionConfig.AntiPrompt, new { @type="text", @class = "form-control prompt-control"})
  44. </div>
  45. <div class="d-flex flex-column mb-2">
  46. <small>OutputFilter</small>
  47. @Html.TextBoxFor(m => Model.SessionConfig.OutputFilter, new { @type="text", @class = "form-control prompt-control"})
  48. </div>
  49. </div>
  50. <div class="tab-pane fade" id="nav-params" role="tabpanel" aria-labelledby="nav-params-tab">
  51. @{
  52. await Html.RenderPartialAsync("_Parameters", Model.InferenceOptions);
  53. }
  54. </div>
  55. </div>
  56. </div>
  57. </form>
  58. </div>
  59. <div class="d-flex flex-grow-1"></div>
  60. <div id="session-details" class="m-1"></div>
  61. <div class="m-1">
  62. <button class="btn btn-outline-success w-100" type="button" id="load">
  63. <div class="d-flex align-items-center justify-content-center">
  64. <img class="spinner me-2" style="display:none" src="~/image/loading.gif" width="20" />
  65. Begin Session
  66. </div>
  67. </button>
  68. <button class="btn btn-outline-danger w-100" type="button" id="unload" style="display:none">End Session</button>
  69. </div>
  70. </div>
  71. <div class="d-flex flex-column h-100 w-75">
  72. <div class="section-head">
  73. </div>
  74. <div id="scroll-container" class="section-content border">
  75. <div id="output-container" class="d-flex flex-column gap-1 p-1">
  76. </div>
  77. </div>
  78. <div class="section-foot">
  79. <div class="input-group mt-2">
  80. <textarea id="input" type="text" class="form-control" value="what is a tree?" style="resize:none" rows="4">What is an apple?</textarea>
  81. <div class="d-flex flex-column">
  82. <div class="d-flex flex-fill">
  83. <button class="btn btn-outline-secondary input-control w-100" type="button" id="send" disabled="disabled" autocomplete="off">Send Message</button>
  84. </div>
  85. <div class="d-flex">
  86. <button class="btn btn-outline-secondary w-100" type="button" id="cancel" autocomplete="off">
  87. <i class="bi-x-circle"></i>
  88. </button>
  89. <button class="btn btn-outline-secondary input-control w-100" type="button" id="clear" disabled="disabled" autocomplete="off">
  90. <i class="bi-trash3"></i>
  91. </button>
  92. </div>
  93. </div>
  94. </div>
  95. </div>
  96. </div>
  97. </div>
  98. @{
  99. await Html.RenderPartialAsync("_ChatTemplates");
  100. }
  101. @section Scripts {
  102. <script src="~/js/sessionconnectionchat.js"></script>
  103. <script>
  104. createConnectionSessionChat();
  105. </script>
  106. }