|
<!DOCTYPE html> |
|
<html> |
|
<head> |
|
<meta charset="utf-8" /> |
|
<meta name="viewport" content="width=device-width" /> |
|
<title>Speech Recognition Vue - HuggingFace.js Live Examples</title> |
|
<link rel="stylesheet" href="pico.classless.min.css" /> |
|
<link rel="stylesheet" href="main.css" /> |
|
<script src="https://unpkg.com/vue@3/dist/vue.global.js"></script> |
|
</head> |
|
<body> |
|
<div id="app" class="container"> |
|
<h1>Speech Recognition</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="audio-select">Select an audio</label> |
|
<select id="audio-select" v-model="selectedAudio"> |
|
<option v-for="audioFile in audioFiles" :value="audioFile"> |
|
{{ audioFile }} |
|
</option> |
|
</select> |
|
</div> |
|
<div> |
|
<label id="audio-label">Audio Player</label> |
|
<audio id="audio" controls :src="selectedAudio"></audio> |
|
</div> |
|
</div> |
|
<button class="btn-success" @click="run">Transcribe</button> |
|
<h3>{{statusMessage}}</h3> |
|
<p>{{recognizedText}}</p> |
|
</div> |
|
<script type="module" src="./index.js"></script> |
|
</body> |
|
</html> |
|
|