Skip to content

Commit

Permalink
Merge 4649a18 into 11f080e
Browse files Browse the repository at this point in the history
  • Loading branch information
tarepan authored Dec 17, 2023
2 parents 11f080e + 4649a18 commit 32f46d7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
10 changes: 5 additions & 5 deletions test/test_synthesis_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def yukarin_s_mock(length: int, phoneme_list: numpy.ndarray, style_id: numpy.nda
result = []
# mockとしての適当な処理、特に意味はない
for i in range(length):
result.append(float(phoneme_list[i] * 0.5 + style_id))
result.append((phoneme_list[i] * 0.5 + style_id).item())
return numpy.array(result)


Expand All @@ -83,7 +83,7 @@ def yukarin_sa_mock(
# mockとしての適当な処理、特に意味はない
for i in range(length):
result.append(
float(
(
(
vowel_phoneme_list[0][i]
+ consonant_phoneme_list[0][i]
Expand All @@ -94,7 +94,7 @@ def yukarin_sa_mock(
)
* 0.5
+ style_id
)
).item()
)
return numpy.array(result)[numpy.newaxis]

Expand All @@ -112,10 +112,10 @@ def decode_mock(
# decode forwardはデータサイズがlengthの256倍になるのでとりあえず256回データをresultに入れる
for _ in range(256):
result.append(
float(
(
f0[i][0] * (numpy.where(phoneme[i] == 1)[0] / phoneme_size)
+ style_id
)
).item()
)
return numpy.array(result)

Expand Down
10 changes: 5 additions & 5 deletions test/test_synthesis_engine_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def yukarin_s_mock(length: int, phoneme_list: numpy.ndarray, style_id: numpy.nda
result = []
# mockとしての適当な処理、特に意味はない
for i in range(length):
result.append(round(float(phoneme_list[i] * 0.0625 + style_id), 2))
result.append(round((phoneme_list[i] * 0.0625 + style_id).item(), 2))
return numpy.array(result)


Expand All @@ -31,7 +31,7 @@ def yukarin_sa_mock(
for i in range(length):
result.append(
round(
float(
(
(
vowel_phoneme_list[0][i]
+ consonant_phoneme_list[0][i]
Expand All @@ -42,7 +42,7 @@ def yukarin_sa_mock(
)
* 0.0625
+ style_id
),
).item(),
2,
)
)
Expand All @@ -62,10 +62,10 @@ def decode_mock(
# decode forwardはデータサイズがlengthの256倍になるのでとりあえず256回データをresultに入れる
for _ in range(256):
result.append(
float(
(
f0[i][0] * (numpy.where(phoneme[i] == 1)[0] / phoneme_size)
+ style_id
)
).item()
)
return numpy.array(result)

Expand Down

0 comments on commit 32f46d7

Please sign in to comment.