Spaces:
Paused

Inflect-v3 / frontend.html
owensong's picture
Fix player contrast, enlarge and label playback controls, autoplay newly generated takes
6730a16 verified
Raw History Blame Contribute Delete
9.43 kB
<div id="inflect-app" data-preview-base="/gradio_api/file=__ASSET_PATH__/previews/">
<header class="app-header"><a class="wordmark" href="https://huggingface.co/owensong" target="_blank" rel="noopener">inflect<span>v3</span></a><nav aria-label="Project"><a href="https://huggingface.co/owensong/Inflect-Mini-v3" target="_blank" rel="noopener">Models</a><a href="https://github.com/owenawsong/Inflect" target="_blank" rel="noopener">Source <svg viewBox="0 0 16 16" aria-hidden="true"><path d="M4 12 12 4M4 4h8v8"/></svg></a></nav></header>
<section aria-label="Speech playground">
<div class="page-heading"><h1>Speech playground</h1><div class="mode-tabs" role="group" aria-label="Generation mode"><span class="selection-indicator" aria-hidden="true"></span><button type="button" data-mode="Create" aria-pressed="true">Generate</button><button type="button" data-mode="Compare" aria-pressed="false">Compare models</button></div></div>
<form id="speech-form"><fieldset id="speech-controls"><legend class="sr-only">Speech settings</legend>
<div class="model-row"><span class="field-label" id="model-label">Model</span><div class="model-options" role="group" aria-labelledby="model-label"><span class="selection-indicator" aria-hidden="true"></span><button type="button" data-model="mini" aria-pressed="true"><strong>Mini</strong><span>34.3M</span></button><button type="button" data-model="micro" aria-pressed="false"><strong>Micro</strong><span>11.8M</span></button><button type="button" data-model="atom" aria-pressed="false"><strong>Atom</strong><span>157K</span></button></div><a id="selected-model-link" href="https://huggingface.co/owensong/Inflect-Mini-v3" target="_blank" rel="noopener">Model details <svg viewBox="0 0 16 16" aria-hidden="true"><path d="M4 12 12 4M4 4h8v8"/></svg></a></div>
<div class="workspace">
<section class="writing-area" aria-label="Text editor"><div class="text-heading"><label for="speech-text" class="field-label">Text</label><span id="char-count">99 / 800</span></div><textarea id="speech-text" maxlength="800" spellcheck="false" aria-describedby="char-count" placeholder="Enter the text you want to hear.">Hey, it's good to hear from you. I was just thinking we should catch up. Are you free this weekend?</textarea><div class="example-row"><span>Need a starting point?</span><button type="button" id="example-button">Try an example <svg viewBox="0 0 16 16" aria-hidden="true"><path d="M13 5a5.5 5.5 0 1 0 .5 5M10 5h3V2"/></svg></button></div>
<div class="event-bar"><div class="event-heading"><label class="event-toggle"><input id="event-toggle" type="checkbox" aria-describedby="event-note"><span>Event tags <small>Beta</small></span></label><button type="button" id="enable-events" hidden>Use Mini</button></div><div id="event-tools" role="group" aria-label="Insert an event at the cursor"><button type="button" data-tag="[sigh]" disabled>[sigh]</button><button type="button" data-tag="[gasp]" disabled>[gasp]</button><button type="button" data-tag="[cough]" disabled>[cough]</button><button type="button" data-tag="[laugh]" disabled>[laugh]</button><button type="button" data-tag="[throat_clear]" disabled>[throat_clear]</button><button type="button" data-tag="[inhale]" disabled>[inhale]</button><button type="button" data-tag="[exhale]" disabled>[exhale]</button><button type="button" data-tag="[yawn]" disabled>[yawn]</button></div><p id="event-note">Eight voice-matched event tags. Enable to insert at the cursor.</p></div>
</section>
<aside class="voice-panel" aria-label="Voice and output settings"><div class="voice-heading"><h2 class="field-label">Voice</h2><span id="voice-preview-label">Preview / Mini</span></div><div class="voice-options" role="group" aria-label="Choose a voice"><span class="selection-indicator" aria-hidden="true"></span>
<div class="voice-row"><button type="button" data-voice="cassidy" aria-pressed="true">Cassidy</button><button type="button" data-preview="cassidy" class="preview-button" aria-label="Preview Cassidy"><svg viewBox="0 0 16 16" aria-hidden="true"><path d="m6 4 6 4-6 4Z" fill="currentColor" stroke="none"/></svg></button></div>
<div class="voice-row"><button type="button" data-voice="mark" aria-pressed="false">Mark</button><button type="button" data-preview="mark" class="preview-button" aria-label="Preview Mark"><svg viewBox="0 0 16 16" aria-hidden="true"><path d="m6 4 6 4-6 4Z" fill="currentColor" stroke="none"/></svg></button></div>
<div class="voice-row"><button type="button" data-voice="hope" aria-pressed="false">Hope</button><button type="button" data-preview="hope" class="preview-button" aria-label="Preview Hope"><svg viewBox="0 0 16 16" aria-hidden="true"><path d="m6 4 6 4-6 4Z" fill="currentColor" stroke="none"/></svg></button></div>
<div class="voice-row"><button type="button" data-voice="james" aria-pressed="false">James</button><button type="button" data-preview="james" class="preview-button" aria-label="Preview James"><svg viewBox="0 0 16 16" aria-hidden="true"><path d="m6 4 6 4-6 4Z" fill="currentColor" stroke="none"/></svg></button></div>
<div class="voice-row"><button type="button" data-voice="sophia" aria-pressed="false">Sophia</button><button type="button" data-preview="sophia" class="preview-button" aria-label="Preview Sophia"><svg viewBox="0 0 16 16" aria-hidden="true"><path d="m6 4 6 4-6 4Z" fill="currentColor" stroke="none"/></svg></button></div>
<div class="voice-row"><button type="button" data-voice="jasper" aria-pressed="false">Jasper</button><button type="button" data-preview="jasper" class="preview-button" aria-label="Preview Jasper"><svg viewBox="0 0 16 16" aria-hidden="true"><path d="m6 4 6 4-6 4Z" fill="currentColor" stroke="none"/></svg></button></div>
</div><p class="preview-note">Short samples. Native 24 kHz. No GPU wait.</p><div class="quality-heading"><label class="field-label" for="output-quality">Output</label><button type="button" id="quality-compare" aria-pressed="false">Compare 24 / 48</button></div><div class="select-wrap"><select id="output-quality" aria-describedby="quality-note"><option value="24000" selected>24 kHz / Native</option><option value="48000">48 kHz / Enhanced</option><option value="pair" hidden>24 + 48 kHz / A-B</option></select><svg viewBox="0 0 16 16" aria-hidden="true"><path d="m4 6 4 4 4-4"/></svg></div><p id="quality-note">Native 24 kHz by default. Enhancement is optional with Mini.</p><details class="advanced"><summary>More options <svg viewBox="0 0 16 16" aria-hidden="true"><path d="M3 8h10"/><path class="vertical" d="M8 3v10"/></svg></summary><div><label for="seed-input">Seed</label><input id="seed-input" type="number" value="42" min="0" max="4294967295" step="1" required></div></details></aside>
<div class="submit-row"><span id="keyboard-hint">Ctrl + Enter</span><button id="speak" type="submit"><span id="speak-label">Generate speech</span><svg class="submit-arrow" viewBox="0 0 20 20" aria-hidden="true"><path d="M3 10h13m-5-5 5 5-5 5"/></svg><span class="working-mark" aria-hidden="true"></span></button></div>
</div>
</fieldset></form>
</section>
<div class="request-status" role="status" aria-live="polite"><span id="request-message">English only. Up to 800 characters.</span><span id="elapsed-time"></span></div>
<section class="recent-takes" aria-label="Recent takes" hidden><div class="recent-heading"><h2>Recent takes <span id="history-count">0 / 8</span></h2><button id="clear-history" type="button">Clear session</button></div><div id="history-list"></div><p>Kept in this tab only. Download any audio you want to keep.</p></section>
<section class="output-area" aria-label="Audio output"><div id="output-empty"><h2>Audio output</h2><p>Generate speech to listen, compare and download.</p><span>WAV</span></div><section id="results" aria-label="Generated audio" hidden><div class="results-heading"><h2>Listen</h2><div><span id="result-note"></span><button id="close-player" type="button">Close</button></div></div><div class="listening-tools"><div class="volume-control"><button id="mute-audio" type="button" aria-pressed="false" aria-label="Mute playback"><svg viewBox="0 0 16 16" aria-hidden="true"><path d="M2 6h3l4-3v10l-4-3H2Zm10-1a5 5 0 0 1 0 6"/></svg></button><label for="playback-volume" class="volume-label">Volume</label><input id="playback-volume" type="range" min="0" max="1" step="0.05" value="1"><output id="volume-value" for="playback-volume">100%</output></div><label id="position-control" hidden><input id="match-position" type="checkbox">Keep position when switching</label><button id="reuse-settings" type="button" title="Restore this take's text, model, voice, output and seed">Use these settings</button></div><p id="comparison-note" hidden></p><p id="stale-note" hidden>This take uses different text or settings from the editor.</p><div id="takes"></div></section></section>
<footer class="app-footer"><span>Non-commercial early access.</span><a href="https://huggingface.co/owensong/Inflect-Mini-v3/blob/main/LICENSE.md" target="_blank" rel="noopener">Read the terms <svg viewBox="0 0 16 16" aria-hidden="true"><path d="M4 12 12 4M4 4h8v8"/></svg></a></footer><audio id="voice-preview-audio" preload="none" hidden></audio><noscript>This playground needs JavaScript to generate and play speech.</noscript>
</div>