fix: Docker compatibility issues with Gradio and ElevenLabs API #167
+18
−4
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Proposed changes
This PR fixes three critical issues that prevent ShortGPT from starting in Docker containers:
🐛 Issue 1: Gradio 5.x Localhost Check Fails
Error: ValueError: When localhost is not accessible, a shareable link must be created Cause: Gradio 5.12.0 performs a localhost accessibility check that fails inside Docker containers. Fix: Downgraded to Gradio 4.19.0 which doesn't have this check.
🐛 Issue 2: HuggingFace Hub Import Error
Error: ImportError: cannot import name 'HfFolder' from 'huggingface_hub' Cause: huggingface_hub 1.0+ removed the HfFolder class that Gradio 4.x imports. Fix: Pinned huggingface_hub<1.0.0.
🐛 Issue 3: ElevenLabs API Crash
Error: KeyError: 'voices' Cause: Code crashes when ElevenLabs API key is invalid/missing. Fix: Added try/except error handling - app now gracefully continues with Edge TTS.
Tested on:
Windows 11 with Docker Desktop
python:3.10-slim-bullseye image
✅ UI loads at http://localhost:31415/
✅ All tabs functional
Types of changes
Bugfix (non-breaking change which fixes an issue) 🐛