MJP1998 / Auto_short_generator

Generate your short/reel/tiktok from script and source media! Contains a pipeline that goes from tts to subtitle forced alignement to video editing and completing
21 stars 4 forks source link

AttributeError: module 'pyfoal' has no attribute 'align' #3

Open KalvinThien opened 8 months ago

KalvinThien commented 8 months ago

File "d:\tool_tao_video\AI\src\video_generator.py", line 240, in generate_video final_clip = self.overlay_subtitles(final_clip, get_alignement(script_without_emojis, audio_object), script, File "d:\tool_tao_video\AI\src\video_generator.py", line 56, in get_alignement return pyfoal.align(text, audio_object.get_audio_np_array(), audio_object.get_sample_rate()).json() AttributeError: module 'pyfoal' has no attribute 'align'

hi @MJP1998 , i get a erorr module 'pyfoal' has no attribute 'align' . how can i fix this Attribute. thanks you

def get_alignement(text, audio_object): return pyfoal.align(text, audio_object.get_audio_np_array(), audio_object.get_sample_rate()).json()

MJP1998 commented 8 months ago

Hi @KalvinThien, Did you check if you have the version of pyfoal I used? pyfoal==0.0.4 (in the requirements.txt) also check this page for the installation (you will need HTK) An update of pyfoal came out a few weeks ago and has no 'align' so I think that's the issue here, I'll make the switch in the future Hope this helps!

KalvinThien commented 8 months ago

Yes, I have installed all modules in requirements.txt As for HTK, I don't know how to install it on a Windows 10 computer. Traceback (most recent call last): File "d:\tool_tao_video\gui.py", line 127, in generateVideoAI ai_content(script_content) # Call the ai_content function with the entered content File "d:\tool_tao_video\AI\main.py", line 73, prints ai_content video_file_path = video_generator.generate_video(audio_object, video.script, video.title, File "d:\tool_creation_video\AI\src\video_generator.py", line 240, in generate_video final_clip = self.overlay_subtitles(final_clip, get_alignement(script_without_emojis, audio_object), script, File "d:\tool_tao_video\AI\src\video_generator.py", line 55, print get_alignement return pyfoal.align(text, audio_object.get_audio_np_array(), audio_object.get_sample_rate()).json() File "C:\Users\KalvinThien\AppData\Roaming\Python\Python310\site-packages\pyfoal\core.py", line 56, in align return align.aligner(text, audio, duration) File "C:\Users\KalvinThien\AppData\Roaming\Python\Python310\site-packages\pyfoal\core.py", line 143, prints call self.format(directory, audio, script_file) File "C:\Users\KalvinThien\AppData\Roaming\Python\Python310\site-packages\pyfoal\core.py", line 200, in format subprocess.Popen( File "C:\Program Files\Python310\lib\subprocess.py", line 971, prints init self._execute_child(args, executable, preexec_fn, close_fds, File "C:\Program Files\Python310\lib\subprocess.py", line 1456, print _execute_child hp, ht, pid, tid = _winapi.CreateProcess(executable, args, FileNotFoundError: [WinError 2] The system cannot find the file specified

MJP1998 commented 8 months ago

You can follow these instructions to install it