From 224665a4bae7a46cbefe63c59014a23697b281b8 Mon Sep 17 00:00:00 2001 From: Fabian Wolf Date: Thu, 8 Aug 2024 11:08:54 +0200 Subject: [PATCH] Change dependencies --- app.py | 9 +++++++++ requirements.txt | 3 ++- webapp/llm_processing/forms.py | 2 +- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/app.py b/app.py index 61609a7..5f85285 100644 --- a/app.py +++ b/app.py @@ -91,6 +91,15 @@ def create_parser(): app.config["MODE"] = args.mode + + # if model path is relative, make it absolute + if not os.path.isabs(app.config["MODEL_PATH"]): + app.config["MODEL_PATH"] = os.path.abspath(app.config["MODEL_PATH"]) + + # if server path is relative, make it absolute + if not os.path.isabs(app.config["SERVER_PATH"]): + app.config["SERVER_PATH"] = os.path.abspath(app.config["SERVER_PATH"]) + print("Start Server on http://" + args.host + ":" + str(args.port)) if args.host == "0.0.0.0": print("Please use http://localhost:" + str(args.port) + " to access the web app locally or the IP / hostname of your server to access the web app in your local network.") diff --git a/requirements.txt b/requirements.txt index 90a5edf..016176e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -23,4 +23,5 @@ surya-ocr scikit-learn prometheus_client PyMuPDF -aiohttp \ No newline at end of file +aiohttp +openpyxl \ No newline at end of file diff --git a/webapp/llm_processing/forms.py b/webapp/llm_processing/forms.py index dc9af12..42a16e5 100644 --- a/webapp/llm_processing/forms.py +++ b/webapp/llm_processing/forms.py @@ -113,7 +113,7 @@ def __init__(self, config_file_path, model_path, *args, **kwargs): self.model.choices = model_choices if model_path: self.model.validators = [FileExistsValidator( - message='File does not exist.', path=model_path)] + message='Model path does not exist.', path=model_path)] # self.model.validators.append(FileExistsValidator(message='File does not exist.', path=model_path)) else: raise ValueError("Model path is required")