soof commited on
Commit
515ebe9
·
verified ·
1 Parent(s): 583c172

Handler loads model from model/ subdir

Browse files
Files changed (1) hide show
  1. handler.py +6 -1
handler.py CHANGED
@@ -82,7 +82,12 @@ class EndpointHandler:
82
  def __init__(self, path: str = ""):
83
  model_dir = Path(path)
84
 
85
- self.bi_encoder = SentenceTransformer(str(model_dir))
 
 
 
 
 
86
 
87
  # Load precomputed category embeddings (numpy, no faiss needed)
88
  self.category_embeddings = np.load(
 
82
  def __init__(self, path: str = ""):
83
  model_dir = Path(path)
84
 
85
+ # Load from model/ subdir to avoid ST auto-detection at repo root
86
+ model_path = model_dir / "model"
87
+ if model_path.exists():
88
+ self.bi_encoder = SentenceTransformer(str(model_path))
89
+ else:
90
+ self.bi_encoder = SentenceTransformer(str(model_dir))
91
 
92
  # Load precomputed category embeddings (numpy, no faiss needed)
93
  self.category_embeddings = np.load(