Spaces:
Running
Running
Update text-to-text-generation.html
Browse files
text-to-text-generation.html
CHANGED
|
@@ -90,13 +90,17 @@
|
|
| 90 |
}
|
| 91 |
async function generateText() {
|
| 92 |
const textFieldValue = document.getElementById("text-to-textGenerationText").value.trim();
|
|
|
|
|
|
|
| 93 |
const result = await generator(textFieldValue, {
|
| 94 |
max_new_tokens: 100,
|
| 95 |
});
|
| 96 |
-
document.getElementById("outputArea").innerText = JSON.stringify(result, null, 2);
|
| 97 |
}
|
| 98 |
async function generateText2() {
|
| 99 |
const textFieldValue = document.getElementById("text-to-textGenerationText2").value.trim();
|
|
|
|
|
|
|
| 100 |
const result = await generator(textFieldValue, {
|
| 101 |
max_new_tokens: 200,
|
| 102 |
temperature: 0.9,
|
|
@@ -105,7 +109,7 @@
|
|
| 105 |
// top_k: 20,
|
| 106 |
// do_sample: true,
|
| 107 |
});
|
| 108 |
-
document.getElementById("outputArea2").innerText = JSON.stringify(result, null, 2);
|
| 109 |
}
|
| 110 |
// Initialize the model after the DOM is completely loaded
|
| 111 |
window.addEventListener("DOMContentLoaded", initializeModel);
|
|
|
|
| 90 |
}
|
| 91 |
async function generateText() {
|
| 92 |
const textFieldValue = document.getElementById("text-to-textGenerationText").value.trim();
|
| 93 |
+
const currentDate = new Date().toDateString();
|
| 94 |
+
const currentTime = new Date().toLocaleTimeString();
|
| 95 |
const result = await generator(textFieldValue, {
|
| 96 |
max_new_tokens: 100,
|
| 97 |
});
|
| 98 |
+
document.getElementById("outputArea").innerText = `Current Date: ${currentDate}\nCurrent Time: ${currentTime}\n\n${JSON.stringify(result, null, 2)}`;
|
| 99 |
}
|
| 100 |
async function generateText2() {
|
| 101 |
const textFieldValue = document.getElementById("text-to-textGenerationText2").value.trim();
|
| 102 |
+
const currentDate = new Date().toDateString();
|
| 103 |
+
const currentTime = new Date().toLocaleTimeString();
|
| 104 |
const result = await generator(textFieldValue, {
|
| 105 |
max_new_tokens: 200,
|
| 106 |
temperature: 0.9,
|
|
|
|
| 109 |
// top_k: 20,
|
| 110 |
// do_sample: true,
|
| 111 |
});
|
| 112 |
+
document.getElementById("outputArea2").innerText = `Current Date: ${currentDate}\nCurrent Time: ${currentTime}\n\n${JSON.stringify(result, null, 2)}`;
|
| 113 |
}
|
| 114 |
// Initialize the model after the DOM is completely loaded
|
| 115 |
window.addEventListener("DOMContentLoaded", initializeModel);
|