whisper-diarization icon indicating copy to clipboard operation
whisper-diarization copied to clipboard

---Installation and run Instructions which worked for me----

Open manjunath7472 opened this issue 1 year ago • 6 comments

Hi there, Below are the steps to make it work in windows. 1.Download repo. 2.Inside repo create a python venv. 3.Download and run vs_buildtools.exe from below link. download 4.Go to individual components and check MSVCv143 c++ x64/x86 build tools MSVCv140 c++ x64/x86 build tools windows 10 SDK (latest) 5.activate venv. 6.pip install Cython. 7.pip install -r requirements.txt.

8.If your using .ipynb file, then remove lines in transcribe cell. del whisper_model torch.cuda.empty_cache()

  1. update definition "_get_next_start_timestamp"
def _get_next_start_timestamp(word_timestamps, current_word_index):
        # if current word is the last word
        if current_word_index == len(word_timestamps) - 1:
            return word_timestamps[current_word_index]["start"]
        next_word_index = current_word_index + 1
        while current_word_index < len(word_timestamps) - 1:
            if word_timestamps[next_word_index].get("start") is None:
                # if next word doesn't have a start timestamp
                # merge it with the current word and delete it
                if word_timestamps[next_word_index]["word"] is not None:
                    
                    word_timestamps[current_word_index]["word"] += (
                        " " + str(word_timestamps[next_word_index]["word"])
                    )
                    word_timestamps[next_word_index]["word"] = None
                    next_word_index += 1
                else:                
                    next_word_index += 1
            else:
                return word_timestamps[next_word_index]["start"]

manjunath7472 avatar Oct 16 '23 06:10 manjunath7472

Thank you Ashraf for pipeline! It's good. As matter of fact am not using Realigning speech segments with punctuation. it is breaking whole purpose of diarization as it is merging chats. Otherwise its good.

manjunath7472 avatar Oct 16 '23 06:10 manjunath7472

Thanks @manjunath7472 for your words, the function modification that you provided is not necessary as the if condition is always evaluated to True, also word_timestamps[next_word_index]["word"] is always a string so no conversion needed

MahmoudAshraf97 avatar Oct 16 '23 11:10 MahmoudAshraf97

But for me i got None as value for word_timestamps[next_word_index]["word"] at one instance some where.

manjunath7472 avatar Oct 18 '23 11:10 manjunath7472

that was already fixed in a recent commit, please pull the latest code

MahmoudAshraf97 avatar Oct 18 '23 12:10 MahmoudAshraf97

oh ok cool. I ll take. Thank you.

manjunath7472 avatar Oct 18 '23 12:10 manjunath7472

install venv in the python 3.10

gallojorge avatar Oct 27 '23 02:10 gallojorge