TalkBank / batchalign2

Tools for language sample analysis.
https://talkbank.org/info/BA2-usage.pdf
BSD 3-Clause "New" or "Revised" License
13 stars 2 forks source link

Batchalign 2 - Unable to run Whisper Engine / Forced Alignment #6

Open RichardGhiuzan opened 1 week ago

RichardGhiuzan commented 1 week ago

I have been using the library version of Batchalign 2 to produce transcripts, and while I've been able to do so, I've been getting a recurrent error whenever trying to run a forced alignment on an existing transcript using the following line of coding:

chat = ba.CHATFile(path = "inputfile.cha") doc = chat.doc nlp = ba.BatchalignPipeline.new("fa", lang="eng", num_speakers=2) doc = nlp(chat) final = ba.CHATFile(doc=doc) final.write("final.cha")

I get a very lengthy error output, which I can share if needed, but this seems to be the main error: RuntimeError Traceback (most recent call last) Cell In[38], line 4 2 chat = ba.CHATFile(path = "inputfile.cha") 3 doc = chat.doc ----> 4 nlp = ba.BatchalignPipeline.new("fa", lang="eng", num_speakers=2) 5 doc = nlp(chat) 6 final = ba.CHATFile(doc=doc)

[...]

2572 raise ValueError( 2573 "You cannot cast a GPTQ model in a new dtype. Make sure to load the model using from_pretrained using the desired" 2574 " dtype by passing the correct torch_dtype argument."

Would anyone have encountered a similar error and know how to solve it? Thank you in advance for the time and availability. Kind Regards, Richard

Jemoka commented 12 hours ago

Apologies about this! Looking at your script, could you try:

chat = ba.CHATFile(path = "inputfile.cha")
doc = chat.doc
nlp = ba.BatchalignPipeline.new("fa", lang="eng", num_speakers=2)
# this is wrong: ~~doc = nlp(chat)~~
doc = nlp(doc)
final = ba.CHATFile(doc=doc)
final.write("final.cha")

However, something is really odd on that none of this should involve GPTQ in any way.