debug: 修复语音克隆输出错误的bug

This commit is contained in:
killua committed 2024-05-23 15:19:21 +08:00
1 parent 3b9cc44e4c
commit e2f3decfae
3 files changed
+37 -19

No files matched your search

+20 -4
View File
@@ -63,7 +63,7 @@ class ChatServiceTest:
current_file_path = os.path.abspath(__file__)
current_file_path = os.path.dirname(current_file_path)
tests_dir = os.path.dirname(current_file_path)
mp3_file_path = os.path.join(tests_dir, 'assets', 'demo_speaker0.mp3')
mp3_file_path = os.path.join(tests_dir, 'assets', 'BarbieDollsVoice.mp3')
with open(mp3_file_path, 'rb') as audio_file:
files = {'audio_file':(mp3_file_path, audio_file, 'audio/mpeg')}
response = requests.post(url,files=files)
@@ -73,6 +73,22 @@ class ChatServiceTest:
else:
raise Exception("音频上传失败")
#绑定音频
url = f"{self.socket}/users/audio/bind"
payload = json.dumps({
"user_id":self.user_id,
"audio_id":self.audio_id
})
headers = {
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
if response.status_code == 200:
print("音频绑定测试成功")
else:
raise Exception("音频绑定测试失败")
#创建一个对话
url = f"{self.socket}/chats"
payload = json.dumps({
@@ -339,10 +355,10 @@ def chat_test():
chat_service_test.test_create_chat()
chat_service_test.test_session_id_query()
chat_service_test.test_session_content_query()
chat_service_test.test_session_update()
# chat_service_test.test_session_update()
asyncio.run(chat_service_test.test_chat_temporary())
asyncio.run(chat_service_test.test_chat_lasting())
asyncio.run(chat_service_test.test_voice_call())
# asyncio.run(chat_service_test.test_chat_lasting())
# asyncio.run(chat_service_test.test_voice_call())
chat_service_test.test_chat_delete()