Rahka commited on
Commit
67f47da
1 Parent(s): 66bfffb

fix taxonomy not found error

Browse files
Files changed (1) hide show
  1. pipeline.py +2 -2
pipeline.py CHANGED
@@ -2,7 +2,7 @@ from sentence_transformers import SentenceTransformer
2
  from sentence_transformers import util
3
  import torch
4
  import json
5
-
6
 
7
  class PipelineWrapper:
8
 
@@ -13,7 +13,7 @@ class PipelineWrapper:
13
  def __init__(self, path=""):
14
  device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
15
  self.model = SentenceTransformer(path, device=device, use_auth_token=True)
16
- self.taxonomy = "taxonomy.json"
17
  self.taxonomy_labels = None
18
  self.taxonomy_embeddings = None
19
  self.load_taxonomy_labels()
 
2
  from sentence_transformers import util
3
  import torch
4
  import json
5
+ import os
6
 
7
  class PipelineWrapper:
8
 
 
13
  def __init__(self, path=""):
14
  device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
15
  self.model = SentenceTransformer(path, device=device, use_auth_token=True)
16
+ self.taxonomy = os.path.join(path, "taxonomy.json")
17
  self.taxonomy_labels = None
18
  self.taxonomy_embeddings = None
19
  self.load_taxonomy_labels()