You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
conversation = [
{'role': 'system', 'content': 'You are a helpful assistant.'},
{"role": "user", "content": [
{"type": "audio", "audio_url": audio_path},
{"type": "text", "text": "判断音频的音色是男性还是女性"},
]},
]
text = processor.apply_chat_template(conversation, add_generation_prompt=True, tokenize=False)
audios = []
for message in conversation:
if isinstance(message["content"], list):
for ele in message["content"]:
if ele["type"] == "audio":
audios.append(librosa.load(ele['audio_url'], sr=processor.feature_extractor.sampling_rate)[0])
出现警告:
It is strongly recommended to pass the sampling_rate argument to this function. Failing to do so can result in silent errors that might be hard to debug.
The text was updated successfully, but these errors were encountered:
改成读取本地路径的代码后:
conversation = [
{'role': 'system', 'content': 'You are a helpful assistant.'},
{"role": "user", "content": [
{"type": "audio", "audio_url": audio_path},
{"type": "text", "text": "判断音频的音色是男性还是女性"},
]},
]
text = processor.apply_chat_template(conversation, add_generation_prompt=True, tokenize=False)
audios = []
for message in conversation:
if isinstance(message["content"], list):
for ele in message["content"]:
if ele["type"] == "audio":
audios.append(librosa.load(ele['audio_url'], sr=processor.feature_extractor.sampling_rate)[0])
出现警告:
It is strongly recommended to pass the
sampling_rate
argument to this function. Failing to do so can result in silent errors that might be hard to debug.The text was updated successfully, but these errors were encountered: