marouane53 / transcribe

MIT License
160 stars 74 forks source link

wit_file_utils?? #1

Open yassinerebas opened 8 months ago

yassinerebas commented 8 months ago

[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 commented 8 months ago

Try python 3.9

On Thu, Mar 28, 2024, 4:45 AM yassinerebas @.***> wrote:

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

— Reply to this email directly, view it on GitHub https://github.com/marouane53/transcribe/issues/1, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAT3QSHASOZTDBDB3J6AXL3Y2PYDHAVCNFSM6AAAAABFMUABJGVHI2DSMVQWIX3LMV43ASLTON2WKOZSGIYTGMBRGI3TMNQ . You are receiving this because you are subscribed to this thread.Message ID: @.***>

odnar-dev commented 7 months ago

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

marouane53 commented 7 months ago

The difference in behavior could be due to variations in the runtime environment or Tafrigh library version. The added import statement in your fork might have resolved an issue specific to your setup. If the original code works without the import, it may not be necessary. Code behavior can be influenced by factors like library versions and dependencies.

On Thu, Mar 28, 2024, 12:46 PM odnar-dev @.***> wrote:

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

— Reply to this email directly, view it on GitHub https://github.com/marouane53/transcribe/issues/1#issuecomment-2025984751, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAT3QSFXCZATQJAJV5KPEFDY2RXQJAVCNFSM6AAAAABFMUABJGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMRVHE4DINZVGE . You are receiving this because you commented.Message ID: @.***>

odnar-dev commented 7 months ago

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

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 commented 7 months ago

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 commented 7 months ago

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 commented 7 months ago

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

BounharAbdelaziz commented 7 months ago

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

AliOsm commented 4 months ago

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 commented 4 months ago

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