Tomtom84 commited on
Commit
9eab5c2
·
1 Parent(s): bd409ef
orpheus-tts/__pycache__/kartoffel_decoder.cpython-310.pyc CHANGED
Binary files a/orpheus-tts/__pycache__/kartoffel_decoder.cpython-310.pyc and b/orpheus-tts/__pycache__/kartoffel_decoder.cpython-310.pyc differ
 
orpheus-tts/kartoffel_decoder.py CHANGED
@@ -42,14 +42,14 @@ def redistribute_codes_kartoffel(code_list):
42
  if i == 0: # Nur für die erste Gruppe
43
  print(f"DEBUG KARTOFFEL: First group codes: {code_list[base_idx:base_idx+7]}")
44
 
45
- # Exakt wie in der funktionierenden Referenz-Implementierung
46
- code_0 = code_list[base_idx]
47
- code_1 = code_list[base_idx + 1] - 4096
48
- code_2 = code_list[base_idx + 2] - (2 * 4096)
49
- code_3 = code_list[base_idx + 3] - (3 * 4096)
50
- code_4 = code_list[base_idx + 4] - (4 * 4096)
51
- code_5 = code_list[base_idx + 5] - (5 * 4096)
52
- code_6 = code_list[base_idx + 6] - (6 * 4096)
53
 
54
  layer_1.append(code_0)
55
  layer_2.append(code_1)
 
42
  if i == 0: # Nur für die erste Gruppe
43
  print(f"DEBUG KARTOFFEL: First group codes: {code_list[base_idx:base_idx+7]}")
44
 
45
+ # SNAC erwartet Codes im Bereich 0-4095 - Clamping ist notwendig!
46
+ code_0 = min(max(code_list[base_idx], 0), 4095)
47
+ code_1 = min(max(code_list[base_idx + 1] - 4096, 0), 4095)
48
+ code_2 = min(max(code_list[base_idx + 2] - (2 * 4096), 0), 4095)
49
+ code_3 = min(max(code_list[base_idx + 3] - (3 * 4096), 0), 4095)
50
+ code_4 = min(max(code_list[base_idx + 4] - (4 * 4096), 0), 4095)
51
+ code_5 = min(max(code_list[base_idx + 5] - (5 * 4096), 0), 4095)
52
+ code_6 = min(max(code_list[base_idx + 6] - (6 * 4096), 0), 4095)
53
 
54
  layer_1.append(code_0)
55
  layer_2.append(code_1)