diff --git a/.gitignore b/.gitignore index 52a297f0..f0df30cf 100644 --- a/.gitignore +++ b/.gitignore @@ -7,8 +7,7 @@ config-template.ini logs/ logs/work.txt server.log -service/__pycache__/ -frontend/__pycache__/ +**/__pycache__ pk/ badcase.txt config.bak diff --git a/huixiangdou/__pycache__/__init__.cpython-39.pyc b/huixiangdou/__pycache__/__init__.cpython-39.pyc deleted file mode 100644 index 20123b71..00000000 Binary files a/huixiangdou/__pycache__/__init__.cpython-39.pyc and /dev/null differ diff --git a/huixiangdou/__pycache__/main.cpython-39.pyc b/huixiangdou/__pycache__/main.cpython-39.pyc deleted file mode 100644 index 9593377d..00000000 Binary files a/huixiangdou/__pycache__/main.cpython-39.pyc and /dev/null differ diff --git a/huixiangdou/frontend/__pycache__/__init__.cpython-39.pyc b/huixiangdou/frontend/__pycache__/__init__.cpython-39.pyc deleted file mode 100644 index e1c79795..00000000 Binary files a/huixiangdou/frontend/__pycache__/__init__.cpython-39.pyc and /dev/null differ diff --git a/huixiangdou/frontend/__pycache__/lark.cpython-39.pyc b/huixiangdou/frontend/__pycache__/lark.cpython-39.pyc deleted file mode 100644 index a9d3e800..00000000 Binary files a/huixiangdou/frontend/__pycache__/lark.cpython-39.pyc and /dev/null differ diff --git a/huixiangdou/main.py b/huixiangdou/main.py index d28a2dde..eac50d3d 100755 --- a/huixiangdou/main.py +++ b/huixiangdou/main.py @@ -29,12 +29,12 @@ def parse_args(): parser.add_argument('--standalone', action='store_true', default=False, - help='Atuo deploy required Hybrid LLM Service.') + help='Auto deploy required Hybrid LLM Service.') args = parser.parse_args() return args -def check_env(): +def check_env(args): """Check or create config.ini and logs dir.""" if not os.path.exists('logs'): os.makedirs('logs') @@ -51,12 +51,19 @@ def check_env(): f.write(response.content) except Exception as e: logger.error(f'Failed to download file due to {e}') + raise e + + if not os.path.exists(args.work_dir): + logger.warning( + f'args.work_dir dir not exist, auto create {args.work_dir}.') + os.makedirs(args.work_dir) def run(): """Automatically download config, start llm server and run examples.""" - check_env() args = parse_args() + check_env(args) + if args.standalone: # hybrid llm serve server_ready = Value('i', 0) diff --git a/huixiangdou/service/__pycache__/__init__.cpython-39.pyc b/huixiangdou/service/__pycache__/__init__.cpython-39.pyc deleted file mode 100644 index 1f0512b2..00000000 Binary files a/huixiangdou/service/__pycache__/__init__.cpython-39.pyc and /dev/null differ diff --git a/huixiangdou/service/__pycache__/feature_store.cpython-39.pyc b/huixiangdou/service/__pycache__/feature_store.cpython-39.pyc deleted file mode 100644 index f4f51894..00000000 Binary files a/huixiangdou/service/__pycache__/feature_store.cpython-39.pyc and /dev/null differ diff --git a/huixiangdou/service/__pycache__/helper.cpython-39.pyc b/huixiangdou/service/__pycache__/helper.cpython-39.pyc deleted file mode 100644 index 7f0574fa..00000000 Binary files a/huixiangdou/service/__pycache__/helper.cpython-39.pyc and /dev/null differ diff --git a/huixiangdou/service/__pycache__/llm_client.cpython-39.pyc b/huixiangdou/service/__pycache__/llm_client.cpython-39.pyc deleted file mode 100644 index b59be008..00000000 Binary files a/huixiangdou/service/__pycache__/llm_client.cpython-39.pyc and /dev/null differ diff --git a/huixiangdou/service/__pycache__/llm_server_hybrid.cpython-39.pyc b/huixiangdou/service/__pycache__/llm_server_hybrid.cpython-39.pyc deleted file mode 100644 index d41ff375..00000000 Binary files a/huixiangdou/service/__pycache__/llm_server_hybrid.cpython-39.pyc and /dev/null differ diff --git a/huixiangdou/service/__pycache__/sg_search.cpython-39.pyc b/huixiangdou/service/__pycache__/sg_search.cpython-39.pyc deleted file mode 100644 index 3ff94b19..00000000 Binary files a/huixiangdou/service/__pycache__/sg_search.cpython-39.pyc and /dev/null differ diff --git a/huixiangdou/service/__pycache__/web_search.cpython-39.pyc b/huixiangdou/service/__pycache__/web_search.cpython-39.pyc deleted file mode 100644 index c5b7021a..00000000 Binary files a/huixiangdou/service/__pycache__/web_search.cpython-39.pyc and /dev/null differ diff --git a/huixiangdou/service/__pycache__/worker.cpython-39.pyc b/huixiangdou/service/__pycache__/worker.cpython-39.pyc deleted file mode 100644 index ab22b367..00000000 Binary files a/huixiangdou/service/__pycache__/worker.cpython-39.pyc and /dev/null differ