manevamarija commited on
Commit
7be3e2d
·
verified ·
1 Parent(s): 675ea1c

Update handler.py

Browse files
Files changed (1) hide show
  1. handler.py +2 -1
handler.py CHANGED
@@ -5,6 +5,7 @@ import base64
5
  import torch
6
  import csv
7
  from transformers import CLIPProcessor, CLIPModel
 
8
 
9
 
10
  class EndpointHandler():
@@ -14,7 +15,7 @@ class EndpointHandler():
14
  self.model.eval()
15
 
16
  # Load categories from CSV
17
- self.categories = self.load_categories_from_csv("categories.csv")
18
 
19
  def load_categories_from_csv(self, filepath: str) -> List[str]:
20
  categories = []
 
5
  import torch
6
  import csv
7
  from transformers import CLIPProcessor, CLIPModel
8
+ import os
9
 
10
 
11
  class EndpointHandler():
 
15
  self.model.eval()
16
 
17
  # Load categories from CSV
18
+ self.categories = self.load_categories_from_csv(os.path.join(path, "categories.csv"))
19
 
20
  def load_categories_from_csv(self, filepath: str) -> List[str]:
21
  categories = []