broadfield-dev commited on
Commit
804518c
·
verified ·
1 Parent(s): c2e3eb9

Update templates/inference.html

Browse files
Files changed (1) hide show
  1. templates/inference.html +5 -1
templates/inference.html CHANGED
@@ -28,6 +28,9 @@
28
  <div class="card-header bg-primary text-white">Input Text</div>
29
  <div class="card-body">
30
  <div class="mb-3">
 
 
 
31
  <label for="modelSelect" class="form-label">Choose Model</label>
32
  <select class="form-select" id="modelSelect">
33
  <option value="custom" selected>Custom</option>
@@ -82,6 +85,7 @@
82
  const resultContainer = document.getElementById('resultContainer');
83
  const errorAlert = document.getElementById('errorAlert');
84
  const inputModel = document.getElementById('inputModel');
 
85
 
86
  if (model === 'Custom') {
87
  model = inputModel;
@@ -101,7 +105,7 @@
101
  const response = await fetch('/api/summarize', {
102
  method: 'POST',
103
  headers: { 'Content-Type': 'application/json' },
104
- body: JSON.stringify({ text: text, model_name: model })
105
  });
106
 
107
  const data = await response.json();
 
28
  <div class="card-header bg-primary text-white">Input Text</div>
29
  <div class="card-body">
30
  <div class="mb-3">
31
+ <input class="form-control" id="hfToken" rows="10" placeholder="Huggingface Token or .env">
32
+ </div>
33
+ <div class="mb-3">
34
  <label for="modelSelect" class="form-label">Choose Model</label>
35
  <select class="form-select" id="modelSelect">
36
  <option value="custom" selected>Custom</option>
 
85
  const resultContainer = document.getElementById('resultContainer');
86
  const errorAlert = document.getElementById('errorAlert');
87
  const inputModel = document.getElementById('inputModel');
88
+ const hfToken = document.getElementById('hfToken');
89
 
90
  if (model === 'Custom') {
91
  model = inputModel;
 
105
  const response = await fetch('/api/summarize', {
106
  method: 'POST',
107
  headers: { 'Content-Type': 'application/json' },
108
+ body: JSON.stringify({ text: text, model_name: model, hf_token: hfToken })
109
  });
110
 
111
  const data = await response.json();