Katsuya Oda commited on
Commit
50e7175
1 Parent(s): 3ef3c1c

fix: use config.yaml

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