move import check furthger up

This commit is contained in:
Cyberes 2023-09-12 01:05:03 -06:00
parent 40ac84aa9a
commit a84386c311
1 changed files with 7 additions and 7 deletions

View File

@ -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")