Arsala Grey
set up demo. Still needs a bit of tweaking on summary length
2f467bc
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width" />
<title>Summarize Text - HuggingFace.js Live Examples</title>
<link rel="stylesheet" href="/main.css" />
<link rel="stylesheet" href="/pico.classless.min.css" />
<script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
</head>
<body>
<div id="app" class="container">
<h1>Text Summarization</h1>
<div class="grid grid-cols-2 gap-2">
<div>
<label for="hf-token"
>Hugging Face Token (optional but limited if absent)</label
>
<input
id="hf-token"
v-model="token"
placeholder="HF-TOKEN"
type="password"
/>
</div>
<div>
<label for="model-select">Select a model</label>
<select id="model-select" v-model="selectedModel">
<option v-for="model in models" :value="model">{{ model }}</option>
</select>
</div>
</div>
<div class="grid grid-cols-2 gap-2">
<div>
<label for="response-length">Response Length</label>
<select id="response-length" v-model="responseLength">
<option value="50">Short</option>
<option value="150">Medium</option>
<option value="250">Long</option>
</select>
</div>
<div>
<label for="temp">Temperature (Controls Randomness)</label>
<select id="temp" v-model="temperature">
<option value="1.0">1.0</option>
<option value="0.7">0.7</option>
<option value="0.5">0.5</option>
<option value="0.3">0.3</option>
<option value="0.1">0.1</option>
</select>
</div>
</div>
<div class="flex gap-4">
<label for="text-to-summarize">Text To Summarize | Paste your own or load an example:</label>
<a v-for="example in examples" :key="example" @click="loadExampleText(example)">{{example}}</a>
</div>
<textarea
id="text-to-summarize"
v-model="textToSummarize"
></textarea>
<button class="btn-success" @click="run">SUMMARIZE</button>
<h3>{{statusMessage}}</h3>
<p>{{responseText}}</p>
</div>
<script type="module" src="./index.js"></script>
</body>
</html>