Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -57,19 +57,7 @@ def cut_dialogue_history(history_memory, keep_last_n_words = 500):
|
|
57 |
paragraphs = paragraphs[1:]
|
58 |
return '\n' + '\n'.join(paragraphs)
|
59 |
|
60 |
-
|
61 |
-
merged_signal = []
|
62 |
-
sr_1, signal_1 = wavfile.read(audio_path_1)
|
63 |
-
sr_2, signal_2 = wavfile.read(audio_path_2)
|
64 |
-
if sr_1 != sr_2:
|
65 |
-
signal_2 = librosa.resample(signal_2, sr_2, sr_1)
|
66 |
-
merged_signal.append(signal_1)
|
67 |
-
merged_signal.append(signal_2)
|
68 |
-
merged_signal = np.hstack(merged_signal)
|
69 |
-
merged_signal = np.asarray(merged_signal, dtype=np.int16)
|
70 |
-
audio_filename = os.path.join('audio', str(uuid.uuid4())[0:8] + ".wav")
|
71 |
-
wavfile.write(audio_filename, sr_1, merged_signal)
|
72 |
-
return audio_filename
|
73 |
|
74 |
class ConversationBot:
|
75 |
def __init__(self, load_dict):
|
|
|
57 |
paragraphs = paragraphs[1:]
|
58 |
return '\n' + '\n'.join(paragraphs)
|
59 |
|
60 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
61 |
|
62 |
class ConversationBot:
|
63 |
def __init__(self, load_dict):
|