** Thanks for Son Tran for the fixes on the installation guide. Here are the recommanded steps for installing ShortGPT:
You now need Docker to now run ShortGPT. If you can't run it with docker, please use the Google Colab.
First make a .env file with the API keys like this:
OPENAI_API_KEY=sk-_put_your_openai_api_key_here
ELEVENLABS_API_KEY=put_your_eleven_labs_api_key_here
PEXELS_API_KEY=put_your_pexels_api_key_here
To run Dockerfile do this:
docker build -t short_gpt_docker:latest .
docker run -p 31415:31415 --env-file .env short_gpt_docker:latest
Export Docker image:
docker save short_gpt_docker > short_gpt_docker.tar
In short, you need to use:
- Python 3.11.3
- openai package 0.28.0, then upgrade openai-whisper
- ffmpeg 4.2.3
- ImageMagick 7.1.1
sudo apt update && sudo apt upgrade
sudo apt install wget git libltdl-dev libjpeg-dev libpng-dev libtiff-dev libgif-dev libfreetype6-dev liblcms2-dev libxml2-dev wget build-essential libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev libffi-dev zlib1g-dev
wget https://www.python.org/ftp/python/3.11.3/Python-3.11.3.tgz
tar xzf Python-3.11.3.tgz
cd Python-3.11.3
./configure --enable-optimizations
make install
To check the Python version, use this command:
python3.11 -V
To use pip, use this command:
pip3.11 install <package-name>
ShortGPT will accept this version of FFmpeg:
3.1. Install Build Dependencies:
sudo apt update
sudo apt build-dep ffmpeg
3.2. Clone FFmpeg Source Code:
git clone https://git.ffmpeg.org/ffmpeg.git
cd ffmpeg
git checkout n4.2.3
3.3. Configure FFmpeg Build:
./configure --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-avisynth --enable-libopenmpt --enable-shared --disable-static
This step checks for the necessary dependencies and configures the build based on your system.
3.4. Build FFmpeg:
make -j$(nproc)
This step may take some time as it compiles the FFmpeg source code.
3.5. Install FFmpeg:
sudo make install
3.6. Verify Installation:
ffmpeg -version
This should display the version information, and you should see version 4.2.3.
Optional: Update Library Cache:
sudo ldconfig
This updates the dynamic linker run-time bindings.
That's it! You should now have FFmpeg version 4.2.3 installed on your Debian 11 system.
If you are still facing with "libavdevice.so.58" error when running ffmpeg, run this command to fix it, remember to change the path:
echo 'export LD_LIBRARY_PATH=/usr/local/lib:/usr/local/lib64/:/usr/local/lib/x86_64-linux-gnu:$LD_LIBRARY_PATH' >> ~/.bashrc
source ~/.bashrc
4.1. Clone ImageMagick:
sudo git clone https://github.com/ImageMagick/ImageMagick.git
4.2. Go to the ImageMagick folder and run configuration:
cd ImageMagick
./configure
4.3. Make:
sudo make
4.4. Install complied code:
sudo make install
4.5. Update path:
sudo ldconfig /usr/local/lib
4.6. (Optional) Check version
$ magick -version
4.7. Fix Imagemagick policy.xml bug on Linux using MoviePy
!sed -i '/<policy domain="path" rights="none" pattern="@\*"/d' /etc/ImageMagick-6/policy.xml
pip3.11 install -U openai-whisper
pip3.11 install torch==2.1.0
edge-tts==6.1.9
ffmpeg==1.4
ffmpeg-python==0.2.0
gradio==3.38.0==3.38.0
moviepy==1.0.3==1.0.3
openai==0.28.1==0.28.1
pillow==9.0.0==9.0.0
proglog==0.1.10
progress==1.6
protobuf==3.20.3==3.20.3
python-dotenv==1.0.0
questionary==2.0.1
tiktoken==0.5.1
tinydb==4.8.0
tinymongo==0.2.0
torch==2.1.0
torchaudio==2.1.0
whisper-timestamped==1.12.20
yt-dlp==2023.10.13