Code Recorder - HFStudio

Code Recorder

{#if mode === 'local'} Python code to reproduce your actions using a local HFStudio server {:else} Python code to reproduce your actions via the API {/if}

{#if codeHistory.length > 0 || setupCode || importCode}
{/if}
{#if setupCode}
Setup (Run in Terminal) Run once
{#if setupCode === 'pip install huggingface-hub'}
{setupCode}
{:else}
{@html Prism.highlight(setupCode, Prism.languages.bash, 'bash')}
{/if}
{/if} {#if importCode}
Imports (Python) Run once
{@html Prism.highlight(importCode, Prism.languages.python, 'python')}
{/if} {#if !importCode && codeHistory.length === 0}

Start using the UI to see generated code here

{/if} {#each codeHistory as entry, i (entry.id)}
Cell {i + 1}
{@html Prism.highlight(entry.code, Prism.languages.python, 'python')}
{#if entry.result && entry.result.type === 'audio'}
{entry.result.title || 'Generated Audio'}
Duration: {formatDuration(entry.result.duration || 0)}
{/if}
{/each}
{#if copyNotification}
{copyNotification}
{/if}