From a84386c311ab13c369cdab1b3df229fe505c488a Mon Sep 17 00:00:00 2001 From: Cyberes Date: Tue, 12 Sep 2023 01:05:03 -0600 Subject: [PATCH] move import check furthger up --- server.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/server.py b/server.py index fa8c97c..d92a21e 100644 --- a/server.py +++ b/server.py @@ -6,6 +6,13 @@ from threading import Thread from flask import Flask, jsonify, render_template, request +try: + import vllm +except ModuleNotFoundError as e: + print('Could not import vllm-gptq:', e) + print('Please see vllm.md for install instructions') + sys.exit(1) + import config from llm_server import opts from llm_server.config import ConfigLoader, config_default_vars, config_required_vars, mode_ui_names @@ -20,13 +27,6 @@ from llm_server.routes.v1.generate_stats import generate_stats from llm_server.stream import init_socketio from llm_server.threads import MainBackgroundThread -try: - import vllm -except ModuleNotFoundError as e: - print('Could not import vllm-gptq:', e) - print('Please see vllm.md for install instructions') - sys.exit(1) - script_path = os.path.dirname(os.path.realpath(__file__)) config_path_environ = os.getenv("CONFIG_PATH")