taylorj94 commited on
Commit
0d6fa67
·
verified ·
1 Parent(s): 0a736a4

Update handler.py

Browse files
Files changed (1) hide show
  1. handler.py +7 -3
handler.py CHANGED
@@ -30,9 +30,13 @@ class EndpointHandler:
30
  Args:
31
  path (str): Path to the GGUF file.
32
  """
33
- files_and_dirs = os.listdir(".") # "." represents the current directory
34
- print(files_and_dirs)
35
- self.model = Llama(model_path="./Llama-3.2-1B-Instruct-Q4_K_L.gguf")
 
 
 
 
36
  self.tokenizer = self.model.tokenizer # GGUF-specific tokenizer, if available
37
 
38
  def __call__(self, data: Any) -> List[Dict[str, str]]:
 
30
  Args:
31
  path (str): Path to the GGUF file.
32
  """
33
+ # Absolute or relative path to the model file
34
+ model_path = path if path else "./Llama-3.2-1B-Instruct-Q4_K_L.gguf"
35
+
36
+ if not os.path.exists(model_path):
37
+ raise ValueError(f"Model path does not exist: {model_path}")
38
+
39
+ self.model = Llama(model_path=model_path)
40
  self.tokenizer = self.model.tokenizer # GGUF-specific tokenizer, if available
41
 
42
  def __call__(self, data: Any) -> List[Dict[str, str]]: