root commited on
Commit
43d63ec
·
1 Parent(s): ba4d777

changing config path directory

Browse files
Files changed (1) hide show
  1. handler.py +7 -1
handler.py CHANGED
@@ -27,7 +27,13 @@ if device.type != 'cuda':
27
 
28
  class EndpointHandler():
29
  def __init__(self, path=""):
30
- self.config = OmegaConf.load("./configs/prompts/animation.yaml")
 
 
 
 
 
 
31
  self.weight_dtype = torch.float16
32
  self.pipeline = None
33
  self._initialize_pipeline()
 
27
 
28
  class EndpointHandler():
29
  def __init__(self, path=""):
30
+ base_dir = os.path.dirname(os.path.abspath(__file__))
31
+ config_path = os.path.join(base_dir, 'configs', 'prompts', 'animation.yaml')
32
+
33
+ if not os.path.exists(config_path):
34
+ raise FileNotFoundError(f"The configuration file was not found at: {config_path}")
35
+
36
+ self.config = OmegaConf.load(config_path)
37
  self.weight_dtype = torch.float16
38
  self.pipeline = None
39
  self._initialize_pipeline()