tannuiscoding commited on
Commit
8414ee3
·
1 Parent(s): 0f28ff9

Fix model path resolution to use correct project root

Browse files
Files changed (1) hide show
  1. backend/ml/ml_engine.py +1 -1
backend/ml/ml_engine.py CHANGED
@@ -144,7 +144,7 @@ def _load_roberta(ckpt_path: str) -> bool:
144
  def init_models(psycho_model_dir: str, roberta_ckpt: str) -> None:
145
  global DEMO_MODE
146
  # Resolve relative paths from the project root (where app.py lives)
147
- _root = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
148
  if psycho_model_dir and not os.path.isabs(psycho_model_dir):
149
  psycho_model_dir = os.path.join(_root, psycho_model_dir)
150
  if roberta_ckpt and not os.path.isabs(roberta_ckpt):
 
144
  def init_models(psycho_model_dir: str, roberta_ckpt: str) -> None:
145
  global DEMO_MODE
146
  # Resolve relative paths from the project root (where app.py lives)
147
+ _root = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
148
  if psycho_model_dir and not os.path.isabs(psycho_model_dir):
149
  psycho_model_dir = os.path.join(_root, psycho_model_dir)
150
  if roberta_ckpt and not os.path.isabs(roberta_ckpt):