From 00be69912cb0d6b48fc9dacf5a75d35f9e562109 Mon Sep 17 00:00:00 2001 From: Kai Labusch Date: Fri, 4 Apr 2025 14:39:24 +0200 Subject: [PATCH] load configuration realitve to working directory --- qurator/sbb_ner/webapp/app.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/qurator/sbb_ner/webapp/app.py b/qurator/sbb_ner/webapp/app.py index b9797bf..3d8ca57 100644 --- a/qurator/sbb_ner/webapp/app.py +++ b/qurator/sbb_ner/webapp/app.py @@ -16,8 +16,9 @@ from pytorch_pretrained_bert.modeling import (CONFIG_NAME, BertForTokenClassification) app = Flask(__name__) -app.config.from_json('config.json' if not os.environ.get('CONFIG') else os.environ.get('CONFIG')) - +app.config.from_file(os.path.join(os.getcwd(), + 'config.json' if not os.environ.get('CONFIG') + else os.environ.get('CONFIG')), load=json.load) cache = Cache(app) logger = logging.getLogger(__name__)