Katsuya Oda commited on
Commit
ba5463e
1 Parent(s): 81bcdf3

fix: model path

Browse files
Files changed (2) hide show
  1. handler.py +1 -1
  2. handler_test.py +1 -2
handler.py CHANGED
@@ -8,7 +8,7 @@ import torchaudio
8
  class EndpointHandler:
9
  def __init__(self, path=""):
10
  # load the model
11
- self.pipeline = Pipeline.from_pretrained("config.yaml")
12
 
13
  def __call__(self, data: Dict[str, bytes]) -> Dict[str, str]:
14
  """
 
8
  class EndpointHandler:
9
  def __init__(self, path=""):
10
  # load the model
11
+ self.pipeline = Pipeline.from_pretrained(path)
12
 
13
  def __call__(self, data: Dict[str, bytes]) -> Dict[str, str]:
14
  """
handler_test.py CHANGED
@@ -1,7 +1,6 @@
1
  from handler import EndpointHandler
2
- from pathlib import Path
3
 
4
- my_handler = EndpointHandler()
5
 
6
  with open("./handler_test.wav", "rb") as file:
7
  bytes_data = file.read()
 
1
  from handler import EndpointHandler
 
2
 
3
+ my_handler = EndpointHandler(path="config.yaml")
4
 
5
  with open("./handler_test.wav", "rb") as file:
6
  bytes_data = file.read()