33 lines
1.1 KiB
Python
33 lines
1.1 KiB
Python
###################################################################################
|
|
##### IMPORT LIBRARIES #####
|
|
import os, time, sys, threading, subprocess, asyncio
|
|
import config
|
|
import web_app, qt_app
|
|
from logging_config import logger
|
|
from data import create_tables
|
|
sys.path.insert(0, os.path.join(os.path.dirname(__file__), 'helpers'))
|
|
|
|
|
|
|
|
###################################################################################
|
|
create_tables()
|
|
|
|
def main(app):
|
|
logger.info('Configuration:')
|
|
for i in dir(config):
|
|
if not callable(getattr(config, i)) and not i.startswith("__"):
|
|
logger.info(f'{i}: {getattr(config, i)}')
|
|
|
|
if app == 'qt':
|
|
# Start the Qt app
|
|
qt_app.qt_app_main()
|
|
elif app == 'web':
|
|
threading.Thread(target=asyncio.run, args=(web_app.web_app_main(),), daemon=True).start()
|
|
|
|
web_app.app.run(host='0.0.0.0', port=5000, debug=False)
|
|
################### TODO ##################
|
|
# 3. Quantising/finetuning larger LLMs. Consider using Aya-23-8B, Gemma, llama3.2 models.
|
|
|
|
if __name__ == '__main__':
|
|
main('qt')
|
|
|