INNER CODE UNIT · Python
create_gradio_demo
speaches-ai/speaches · src/speaches/ui/app.py:11
def create_gradio_demo(config: Config) -> gr.Blocks:
with gr.Blocks(
title="Speaches Playground",
head="""
<script>
const API_KEY_STORAGE_KEY = 'speaches_api_key';
function saveApiKey(apiKey) {
try {
localStorage.setItem(API_KEY_STORAGE_KEY, apiKey);
} catch (e) {
console.error('Failed to save API key to localStorage:', e);
}
}
function loadApiKey() {
try {
return localStorage.getItem(API_KEY_STORAGE_KEY) || '';