OpenMOSS / OpenMOSS/MOSS-Transcribe-Diarize
loading audio data from an array
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 2.1k
- Forks
- 126
- Avg merge
- 17h 42m
- Merged PRs (30d)
- 5
Description
moss_transcribe_diarize\inference_utils.py
def process_audio_info
Judging by the code, the ability to load audio data from an array was intended, but it doesn't work due to an error
audio = item.get("audio") or item.get("audio_url") or item.get("url") or item.get("path")
ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
You can fix it like this, for example:
#audio = item.get("audio") or item.get("audio_url") or item.get("url") or item.get("path")
audio = None
for key in ["audio", "audio_url", "url", "path"]:
if item.get(key) is not None:
audio = item[key]
break
It would also be worth fixing build_transcription_messages or making a separate function for loading from an array
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in moss_transcribe_diarize/inference_utils.py at process_audio_info and inspect how audio, audio_url, url, and path are selected. Verify that array-valued audio input no longer raises the ambiguous truth-value error, while the other supported input forms still work; also review build_transcription_messages as suggested for related array handling.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- machine-learning
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 74/100