this is an small template to help build the application based on the PyQt5, and integrate the function of the AI calling
# before install , make sure c++ vs desktop has been installed
$ pip install PyQt5 pyinstaller pypdf requests tiktoken openai Pillow python-dotenv openpyxl -i https://pypi.tuna.tsinghua.edu.cn/simple
# rename the "config/.env.production" as "config/.env" and then modify the project enviroment paramters in files "config/.env"
$ mv config/.env.production config/.env
# start the project
$ python main.py
# start current virtual env
$ pipenv shell
# to make the package successful, it's better to isolate current project in en virtual environment
# noted that the "PyQt5Tempalte" is current program default name, when do the compile next time, just change the name into the one that fit your projcts
# windows os
$ pyinstaller main.py --onefile --noconsole --add-data "assets;assets" --icon="assets/Images/icon.ico" -n PyQt5Tempalte --hidden-import=tiktoken_ext.openai_public --hidden-import=tiktoken_ext
# mac/linux os
$ pyinstaller main.py --onefile --noconsole --add-data "assets:assets" --icon="assets/Images/icon.ico" -n PyQt5Tempalte --hidden-import=tiktoken_ext.openai_public --hidden-import=tiktoken_ext
# add the configs and the assets package into the final dist folder
$ cp ./assets ./dist/assets
$ cp ./config ./dist/config
noted: because the pysinstaller only help package the
*.pyfiles, so for the rest resource, you need package it , by yourself.
to resolve the issue of the
Unknown encoding cl100k_base(caused by the tiktoken), so just add the params--hidden-import=tiktoken_ext.openai_public --hidden-import=tiktoken_extwhen packaging current project