Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wit_file_utils?? #1

Open
yassinerebas opened this issue Mar 28, 2024 · 10 comments
Open

wit_file_utils?? #1

yassinerebas opened this issue Mar 28, 2024 · 10 comments

Comments

@yassinerebas
Copy link

[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'?

@marouane53
Copy link
Owner

marouane53 commented Mar 28, 2024 via email

@odnar-dev
Copy link

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

@marouane53
Copy link
Owner

marouane53 commented Mar 28, 2024 via email

@odnar-dev
Copy link

odnar-dev commented Mar 28, 2024

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

@yassinerebas
Copy link
Author

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

@marouane53
Copy link
Owner

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

@BoOoOoOmmm
Copy link

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

@BounharAbdelaziz
Copy link

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

@AliOsm
Copy link

AliOsm commented Jun 28, 2024

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.

@AliOsm
Copy link

AliOsm commented Jun 28, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants