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

На mac os не работает модуль whisper #19

Closed
dipsy opened this issue Jan 23, 2023 · 1 comment · Fixed by #29
Closed

На mac os не работает модуль whisper #19

dipsy opened this issue Jan 23, 2023 · 1 comment · Fixed by #29
Assignees
Labels
enhancement New feature or request

Comments

@dipsy
Copy link

dipsy commented Jan 23, 2023

Все зависимости установлены согласно https://github.com/openai/whisper
Бот не выдает ошибки.
Картинки и текст добавляются нормально.

@samas77
Copy link

samas77 commented Apr 3, 2023

Та же картина на debian и centOS. Если я верно понял ошибка в bot.log:
ERROR Task exception was never retrieved
future: <Task finished name='Task-11' coro=<Dispatcher._process_polling_updates() done, defined at /usr/local/lib/python3.10/site-packages/aiogram/dispatcher/dispatcher.py:407> exception=TypeError("join() argument must be str, bytes, or os.PathLike object, not 'NoneType'")>
Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/aiogram/dispatcher/dispatcher.py", line 415, in _process_polling_updates
for responses in itertools.chain.from_iterable(await self.process_updates(updates, fast)):
File "/usr/local/lib/python3.10/site-packages/aiogram/dispatcher/dispatcher.py", line 235, in process_updates
return await asyncio.gather(*tasks)
File "/usr/local/lib/python3.10/site-packages/aiogram/dispatcher/handler.py", line 117, in notify
response = await handler_obj.handler(*args, **partial_data)
File "/usr/local/lib/python3.10/site-packages/aiogram/dispatcher/dispatcher.py", line 256, in process_update
return await self.message_handlers.notify(update.message)
File "/usr/local/lib/python3.10/site-packages/aiogram/dispatcher/handler.py", line 117, in notify
response = await handler_obj.handler(*args, **partial_data)
File "/media/test/t2o/tg2obsidian_bot.py", line 160, in handle_video
file_name = unique_filename(message.video.file_name, config.photo_path)
File "/media/test/t2o/tg2obsidian_bot.py", line 555, in unique_filename
if not os.path.exists(os.path.join(path, file)):
File "/usr/local/lib/python3.10/posixpath.py", line 90, in join
genericpath._check_arg_types('join', a, *p)
File "/usr/local/lib/python3.10/genericpath.py", line 152, in _check_arg_types
raise TypeError(f'{funcname}() argument must be str, bytes, or '
TypeError: join() argument must be str, bytes, or os.PathLike object, not 'NoneType'

UPD:

  1. проблема легко правиться тем что запуск скрипта выполняется из папки где скрипт лежит, надо будет поправить пути в скрипте
  2. Не во всех сообщениях с видео есть file_name пока поправил костылем:
    @dp.message_handler(content_types=[ContentType.VIDEO])
    async def handle_video(message: Message):

video file name check

if message.video.file_name
   file_name = message.video.file_name
else
   file_name = message.video.file_id + '.mp4'

log_message(message)

@dimonier dimonier self-assigned this May 2, 2023
@dimonier dimonier added the enhancement New feature or request label May 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
3 participants