summaryrefslogtreecommitdiffstats
path: root/ui/config-schema.js
diff options
context:
space:
mode:
authoryum <yum.food.vr@gmail.com>2025-05-30 13:32:36 -0700
committeryum <yum.food.vr@gmail.com>2025-05-30 13:34:23 -0700
commit7fb9c575aea4d318e9c14b82174d1b323171b62b (patch)
tree8f924a32def3bdc963be40e67879887cbac68f08 /ui/config-schema.js
parente1b3f638a1ea448de9691f69eb62ebf4c3944c9f (diff)
More stuff
- fix unicode output from python terminal - fix cpu inference - add filters - add beam search params to UI - DRY up config definition in UI
Diffstat (limited to 'ui/config-schema.js')
-rw-r--r--ui/config-schema.js49
1 files changed, 49 insertions, 0 deletions
diff --git a/ui/config-schema.js b/ui/config-schema.js
new file mode 100644
index 0000000..b1108ff
--- /dev/null
+++ b/ui/config-schema.js
@@ -0,0 +1,49 @@
+// Shared configuration schema with types and defaults
+const CONFIG_SCHEMA = {
+ // String fields
+ compute_type: { type: 'select', default: 'float16' },
+ language: { type: 'select', default: 'english' },
+ model: { type: 'select', default: 'turbo' },
+ microphone: { type: 'number', default: 0 },
+ user_prompt: { type: 'text', default: 'Use proper punctuation and grammar. Prefer spelled out numbers like one, eleven, twenty, etc. Mm.' },
+
+ // Number fields
+ gpu_idx: { type: 'number', default: 0 },
+ max_speech_duration_s: { type: 'number', default: 10 },
+ min_silence_duration_ms: { type: 'number', default: 250 },
+ reset_after_silence_s: { type: 'number', default: 15 },
+ transcription_loop_delay_ms: { type: 'number', default: 100 },
+ block_width: { type: 'number', default: 2 },
+ num_blocks: { type: 'number', default: 40 },
+ rows: { type: 'number', default: 10 },
+ cols: { type: 'number', default: 24 },
+ beam_size: { type: 'number', default: 5 },
+ best_of: { type: 'number', default: 5 },
+
+ // Boolean fields (stored as 1/0)
+ enable_debug_mode: { type: 'boolean', default: 0 },
+ enable_previews: { type: 'boolean', default: 1 },
+ save_audio: { type: 'boolean', default: 0 },
+ use_cpu: { type: 'boolean', default: 0 },
+ enable_lowercase_filter: { type: 'boolean', default: 0 },
+ enable_uppercase_filter: { type: 'boolean', default: 0 },
+ enable_profanity_filter: { type: 'boolean', default: 0 },
+ remove_trailing_period: { type: 'boolean', default: 0 }
+};
+
+// Helper to extract just the default values
+function getDefaultConfig() {
+ const defaults = {};
+ for (const [key, schema] of Object.entries(CONFIG_SCHEMA)) {
+ defaults[key] = schema.default;
+ }
+ return defaults;
+}
+
+// Export for both CommonJS (main process) and ES modules (renderer)
+if (typeof module !== 'undefined' && module.exports) {
+ module.exports = { CONFIG_SCHEMA, getDefaultConfig };
+} else {
+ window.CONFIG_SCHEMA = CONFIG_SCHEMA;
+ window.getDefaultConfig = getDefaultConfig;
+} \ No newline at end of file