marouane53/transcribe

wit_file_utils??

Opened this issue · 10 comments

[youtube] kdvc9Orfk-E: Downloading webpage
[youtube] kdvc9Orfk-E: Downloading ios player API JSON
[youtube] kdvc9Orfk-E: Downloading android player API JSON
[youtube] kdvc9Orfk-E: Downloading m3u8 information
[info] kdvc9Orfk-E: Downloading 1 format(s): 251
[download] Destination: E:\transcribe-main\downloads\kdvc9Orfk-E.webm
[download] 100% of 14.39MiB in 00:00:05 at 2.47MiB/s
[ExtractAudio] Destination: E:\transcribe-main\downloads\kdvc9Orfk-E.wav
Deleting original file E:\transcribe-main\downloads\kdvc9Orfk-E.webm (pass -k to keep)
Transcribing file: E:\transcribe-main\downloads\0URr_XkgAIE.wav
Local files: 0%| | 0/1 [00:00<?, ?it/s]
URLs or local paths: 0%| | 0/1 [00:00<?, ?it/s]
Traceback (most recent call last):
File "E:\transcribe-main\transcribe.py", line 126, in
main()
File "E:\transcribe-main\transcribe.py", line 95, in main
transcribe_file(audio_file, language_sign)
File "E:\transcribe-main\transcribe.py", line 85, in transcribe_file
progress = deque(farrigh(config), maxlen=0)
File "C:\Users\Ingecys\AppData\Local\Programs\Python\Python310\lib\site-packages\tafrigh\cli.py", line 94, in farrigh
for progress_info, local_elements_segments in process_local(file_or_folder, model, config, progress_info):
File "C:\Users\Ingecys\AppData\Local\Programs\Python\Python310\lib\site-packages\tafrigh\cli.py", line 151, in process_local
wav_file_path = str(wit_file_utils.convert_to_wav(file['file_path']).absolute())
NameError: name 'wit_file_utils' is not defined. Did you mean: 'file_utils'?

looks like you need to import wit_file_utils from tafrigh.utils.wit
try my fork here : https://github.com/odnar-dev/transcribe

i had the same problem, using python 3.11.8 and in a new environment


after doing some digging on how tafrigh work, i found this

image

by using some magic called debugging i found that they try to import two back-ends : WitRecognizer , WhisperRecognizer
and if one failed to import they just skip it,
so when they try to import WitRecognizer, which fail because of a missing dependency pydub , they skip importing wit_file_utils
and when your script call the client, it throw the NameError, cause wit_file_utils which is not defined look alot like file_utils

  • so all you need to do to fix this is : install pydub

this is a list of all the dependencies that are related to tafrigh and needed : pydub, scipy, auditok, numpy, requests


or just install tafrigh with : pip install "tafrigh[wit]" which install tafrigh with all dependencies that are related to WitRecognizer

Thank you, guys, it worked

i had the same problem, using python 3.11.8 and in a new environment

after doing some digging on how tafrigh work, i found this

image

by using some magic called debugging i found that they try to import two back-ends : WitRecognizer , WhisperRecognizer and if one failed to import they just skip it, so when they try to import WitRecognizer, which fail because of a missing dependency pydub , they skip importing wit_file_utils and when your script call the client, it throw the NameError, cause wit_file_utils which is not defined look alot like file_utils

  • so all you need to do to fix this is : install pydub

this is a list of all the dependencies that are related to tafrigh and needed : pydub, scipy, auditok, numpy, requests

or just install tafrigh with : pip install "tafrigh[wit]" which install tafrigh with all dependencies that are related to WitRecognizer

i had the same problem, using python 3.11.8 and in a new environment

after doing some digging on how tafrigh work, i found this

image

by using some magic called debugging i found that they try to import two back-ends : WitRecognizer , WhisperRecognizer and if one failed to import they just skip it, so when they try to import WitRecognizer, which fail because of a missing dependency pydub , they skip importing wit_file_utils and when your script call the client, it throw the NameError, cause wit_file_utils which is not defined look alot like file_utils

  • so all you need to do to fix this is : install pydub

this is a list of all the dependencies that are related to tafrigh and needed : pydub, scipy, auditok, numpy, requests

or just install tafrigh with : pip install "tafrigh[wit]" which install tafrigh with all dependencies that are related to WitRecognizer

Amazing work. Thank you

if i want to use it in colab how i do, because i try it and doesn't work.

pip install "tafrigh[wit]" worked for me, thanks @odnar-dev ;)

if i want to use it in colab how i do, because i try it and doesn't work.

Tafrigh is already available on Colab: https://tafrigh.ieasybooks.com.

Tafrigh now is available through Docker with pre-built images, check the docs.