Skip to content

Fix default ElevenLabs voice value and asset_db race crash - #175

Open
cyprogg wants to merge 1 commit into
RayVentura:stablefrom
cyprogg:fix/voice-default-and-assetdb-race
Open

Fix default ElevenLabs voice value and asset_db race crash#175
cyprogg wants to merge 1 commit into
RayVentura:stablefrom
cyprogg:fix/voice-default-and-assetdb-race

Conversation

@cyprogg

@cyprogg cyprogg commented Aug 14, 2026

Copy link
Copy Markdown

Summary

Two startup crashes hit while running the app fresh locally (Windows, venv, no Docker):

  • gui/asset_components.py: the ElevenLabs voice Radio components hardcode value="Chris", but ElevenLabs' default voice library now returns descriptive names (e.g. "Chris - Charming, Down-to-Earth"). Since "Chris" no longer matches any entry in choices, Gradio raises Value: 'Chris' ... is not in the list of choices and the UI fails to build. Added _pickDefaultVoice() to match by name prefix and fall back to the first available voice.

  • shortGPT/config/asset_db.py: get_df() calls sync_local_assets() (which writes to local_assets) immediately before reading cls.remote_assets._get(). TinyMongo can transiently return None right after a write, which crashed get_df() with AttributeError: 'NoneType' object has no attribute 'items'. Guarded both reads with or {}.

Test plan

  • Fresh venv install of requirements.txt on Windows, ran python runShortGPT.py, reproduced both crashes on first launch.
  • Applied the fixes, restarted, confirmed the Gradio UI now builds and serves (HTTP 200 on http://localhost:31415) without errors.

- asset_components.py: ElevenLabs default voices are now returned with
  descriptive names (e.g. "Chris - Charming, Down-to-Earth"), so the
  hardcoded value="Chris" no longer matched any choice and crashed the
  Radio component on startup. Added _pickDefaultVoice() to match by
  prefix and fall back to the first available voice.
- asset_db.py: get_df() calls sync_local_assets() (which writes to
  local_assets) immediately before reading remote_assets._get().
  TinyMongo can transiently return None right after a write, which
  crashed get_df() with AttributeError. Guard both reads with `or {}`.
@cyprogg
cyprogg requested a review from RayVentura as a code owner August 14, 2026 02:56
@vercel

vercel Bot commented Aug 14, 2026

Copy link
Copy Markdown

Someone is attempting to deploy a commit to the ShortX Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant