Skip to content

BertramYe/PyQt5Template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

simple description

this is an small template to help build the application based on the PyQt5, and integrate the function of the AI calling

install

#  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

package

# 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 *.py files, 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_ext when packaging current project

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages