Update text-to-text-generation.html
Browse files
text-to-text-generation.html
CHANGED
|
@@ -8,7 +8,6 @@
|
|
| 8 |
<script type="module">
|
| 9 |
// Import the library
|
| 10 |
import { pipeline } from 'https://cdn.jsdelivr.net/npm/@xenova/transformers@2.5.4';
|
| 11 |
-
|
| 12 |
// Make it available globally
|
| 13 |
window.pipeline = pipeline;
|
| 14 |
</script>
|
|
@@ -84,15 +83,11 @@
|
|
| 84 |
</div>
|
| 85 |
|
| 86 |
<script>
|
| 87 |
-
|
| 88 |
let generator;
|
| 89 |
-
|
| 90 |
// Initialize the sentiment analysis model
|
| 91 |
async function initializeModel() {
|
| 92 |
generator = await pipeline('text2text-generation', 'Xenova/LaMini-Flan-T5-783M');
|
| 93 |
-
|
| 94 |
}
|
| 95 |
-
|
| 96 |
async function generateText() {
|
| 97 |
const textFieldValue = document.getElementById("text-to-textGenerationText").value.trim();
|
| 98 |
const result = await generator(textFieldValue, {
|
|
|
|
| 8 |
<script type="module">
|
| 9 |
// Import the library
|
| 10 |
import { pipeline } from 'https://cdn.jsdelivr.net/npm/@xenova/transformers@2.5.4';
|
|
|
|
| 11 |
// Make it available globally
|
| 12 |
window.pipeline = pipeline;
|
| 13 |
</script>
|
|
|
|
| 83 |
</div>
|
| 84 |
|
| 85 |
<script>
|
|
|
|
| 86 |
let generator;
|
|
|
|
| 87 |
// Initialize the sentiment analysis model
|
| 88 |
async function initializeModel() {
|
| 89 |
generator = await pipeline('text2text-generation', 'Xenova/LaMini-Flan-T5-783M');
|
|
|
|
| 90 |
}
|
|
|
|
| 91 |
async function generateText() {
|
| 92 |
const textFieldValue = document.getElementById("text-to-textGenerationText").value.trim();
|
| 93 |
const result = await generator(textFieldValue, {
|