broadfield-dev commited on
Commit
f45c215
·
verified ·
1 Parent(s): 1d39837

Update templates/inference.html

Browse files
Files changed (1) hide show
  1. templates/inference.html +4 -2
templates/inference.html CHANGED
@@ -44,7 +44,7 @@
44
  <label class="small">Temperature: <span id="temp-val" class="fw-bold">0.7</span></label>
45
  <input type="range" class="form-range" id="temperature" min="0.1" max="1.5" value="0.7" step="0.1" oninput="document.getElementById('temp-val').innerText = this.value">
46
  <label class="small">Top K: <span id="topk-val" class="fw-bold">50</span></label>
47
- <input type="range" class="form-range" id="temperature" min="1" max="100" value="50" step="1" oninput="document.getElementById('topk-val').innerText = this.value">
48
 
49
  </div>
50
  <div class="mb-3">
@@ -93,6 +93,8 @@
93
  const errorAlert = document.getElementById('errorAlert');
94
  const inputModel = document.getElementById('inputModel').value;
95
  const hfToken = document.getElementById('hfToken');
 
 
96
  console.log(model)
97
  if (model === 'custom') {
98
  modelOut = inputModel;
@@ -114,7 +116,7 @@
114
  const response = await fetch('/summarize/api/summarize', {
115
  method: 'POST',
116
  headers: { 'Content-Type': 'application/json' },
117
- body: JSON.stringify({ text: text, model_name: modelOut, hf_token: hfToken })
118
  });
119
 
120
  const data = await response.json();
 
44
  <label class="small">Temperature: <span id="temp-val" class="fw-bold">0.7</span></label>
45
  <input type="range" class="form-range" id="temperature" min="0.1" max="1.5" value="0.7" step="0.1" oninput="document.getElementById('temp-val').innerText = this.value">
46
  <label class="small">Top K: <span id="topk-val" class="fw-bold">50</span></label>
47
+ <input type="range" class="form-range" id="topk" min="1" max="100" value="50" step="1" oninput="document.getElementById('topk-val').innerText = this.value">
48
 
49
  </div>
50
  <div class="mb-3">
 
93
  const errorAlert = document.getElementById('errorAlert');
94
  const inputModel = document.getElementById('inputModel').value;
95
  const hfToken = document.getElementById('hfToken');
96
+ const temperature = document.getElementById('temperature');
97
+ const topk = document.getElementById('topk');
98
  console.log(model)
99
  if (model === 'custom') {
100
  modelOut = inputModel;
 
116
  const response = await fetch('/summarize/api/summarize', {
117
  method: 'POST',
118
  headers: { 'Content-Type': 'application/json' },
119
+ body: JSON.stringify({ text: text, model_name: modelOut, hf_token: hfToken, temp: temperature, topk: topk })
120
  });
121
 
122
  const data = await response.json();