Spaces:
Sleeping
Sleeping
Update templates/inference.html
Browse files- templates/inference.html +6 -4
templates/inference.html
CHANGED
|
@@ -84,11 +84,13 @@
|
|
| 84 |
const loader = document.getElementById('loader');
|
| 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 |
-
|
|
|
|
|
|
|
| 92 |
}
|
| 93 |
if (!text.trim()) {
|
| 94 |
alert("Please enter some text!");
|
|
@@ -105,7 +107,7 @@
|
|
| 105 |
const response = await fetch('/summarize/api/summarize', {
|
| 106 |
method: 'POST',
|
| 107 |
headers: { 'Content-Type': 'application/json' },
|
| 108 |
-
body: JSON.stringify({ text: text, model_name:
|
| 109 |
});
|
| 110 |
|
| 111 |
const data = await response.json();
|
|
|
|
| 84 |
const loader = document.getElementById('loader');
|
| 85 |
const resultContainer = document.getElementById('resultContainer');
|
| 86 |
const errorAlert = document.getElementById('errorAlert');
|
| 87 |
+
const inputModel = document.getElementById('inputModel').value;
|
| 88 |
const hfToken = document.getElementById('hfToken');
|
| 89 |
+
console.log(model)
|
| 90 |
if (model === 'Custom') {
|
| 91 |
+
modelOut = inputModel;
|
| 92 |
+
} else {
|
| 93 |
+
modelOut = model;
|
| 94 |
}
|
| 95 |
if (!text.trim()) {
|
| 96 |
alert("Please enter some text!");
|
|
|
|
| 107 |
const response = await fetch('/summarize/api/summarize', {
|
| 108 |
method: 'POST',
|
| 109 |
headers: { 'Content-Type': 'application/json' },
|
| 110 |
+
body: JSON.stringify({ text: text, model_name: modelOut, hf_token: hfToken })
|
| 111 |
});
|
| 112 |
|
| 113 |
const data = await response.json();
|