Qa5im commited on
Commit
c8fe953
·
1 Parent(s): 0e0eeeb

updated server

Browse files
Files changed (1) hide show
  1. server.py +7 -2
server.py CHANGED
@@ -78,21 +78,26 @@ async def predictor(names, file_uploads, usersNum, recordingsNum):
78
  wav_fpaths = []
79
  file_upload = file_uploads[-1]
80
  data = await file_upload.read()
 
81
  filename = "test¬"+file_upload.filename
82
  file_path = UPLOAD_DIR / filename
 
83
  with open(file_path, "wb") as file_object:
84
  file_object.write(data)
 
85
  wav_fpaths.append(Path(file_path))
 
86
  print("about to test\n")
87
  try:
88
  test_pos_wavs = {speaker: list(map(preprocess_wav, wav_fpaths)) for speaker, wav_fpaths in
89
  groupby(tqdm(wav_fpaths, "Preprocessing wavs", len(wav_fpaths), unit="wavs"),
90
  lambda wav_fpath: "test")}
91
- test_pos_emb = np.array([encoder.embed_speaker(wavs)
92
- for wavs in test_pos_wavs.values()])
93
  except Exception as error:
94
  print("An exception occurred:", type(error).__name__)
95
  print("Exception details:", error)
 
 
96
  # print("test error ", error)
97
 
98
  # calculates cosine similarity between the ground truth (test file) and registered audios
 
78
  wav_fpaths = []
79
  file_upload = file_uploads[-1]
80
  data = await file_upload.read()
81
+ print("data", data)
82
  filename = "test¬"+file_upload.filename
83
  file_path = UPLOAD_DIR / filename
84
+ print("filepath", file_path)
85
  with open(file_path, "wb") as file_object:
86
  file_object.write(data)
87
+
88
  wav_fpaths.append(Path(file_path))
89
+ print("wav_fpath", wav_fpaths)
90
  print("about to test\n")
91
  try:
92
  test_pos_wavs = {speaker: list(map(preprocess_wav, wav_fpaths)) for speaker, wav_fpaths in
93
  groupby(tqdm(wav_fpaths, "Preprocessing wavs", len(wav_fpaths), unit="wavs"),
94
  lambda wav_fpath: "test")}
95
+ print("test_pos_wavs", test_pos_wavs)
 
96
  except Exception as error:
97
  print("An exception occurred:", type(error).__name__)
98
  print("Exception details:", error)
99
+ test_pos_emb = np.array([encoder.embed_speaker(wavs)
100
+ for wavs in test_pos_wavs.values()])
101
  # print("test error ", error)
102
 
103
  # calculates cosine similarity between the ground truth (test file) and registered audios