-
Notifications
You must be signed in to change notification settings - Fork 31
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
Image processing does't working #9
Comments
Yes imaginepy API is down. I am looking for an alternative |
Fixed |
If i send picture to bot, i get this error in terminal |
Fixed. pronlem from wrong variable name |
Error again ERROR:asyncio:Task exception was never retrieved
future: <Task finished name='Task-11' coro=<Dispatcher._process_polling_updates() done, defined at /usr/local/lib/python3.10/dist-packages/aiogram/dispatcher/dispatcher.py:407> exception=TypeError('Constructor parameter should be str')>
Traceback (most recent call last):
File "/usr/local/lib/python3.10/dist-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/dist-packages/aiogram/dispatcher/dispatcher.py", line 235, in process_updates
return await asyncio.gather(*tasks)
File "/usr/local/lib/python3.10/dist-packages/aiogram/dispatcher/handler.py", line 117, in notify
response = await handler_obj.handler(*args, **partial_data)
File "/usr/local/lib/python3.10/dist-packages/aiogram/dispatcher/dispatcher.py", line 256, in process_update
return await self.message_handlers.notify(update.message)
File "/usr/local/lib/python3.10/dist-packages/aiogram/dispatcher/handler.py", line 117, in notify
response = await handler_obj.handler(*args, **partial_data)
File "/home/ubuntu/Telegrambot-with-GPT4free/main.py", line 255, in imageaudio_handler
text = await bm.generate_imagecaption(image_url,HG_TOKEN)
File "/home/ubuntu/Telegrambot-with-GPT4free/bot/botmedia.py", line 26, in generate_imagecaption
async with session.post(self.HG_img2text, headers=headers, data=await resp1.read()) as resp2:
File "/usr/local/lib/python3.10/dist-packages/aiohttp/client.py", line 1141, in __aenter__
self._resp = await self._coro
File "/usr/local/lib/python3.10/dist-packages/aiohttp/client.py", line 423, in _request
url = self._build_url(str_or_url)
File "/usr/local/lib/python3.10/dist-packages/aiohttp/client.py", line 357, in _build_url
url = URL(str_or_url)
File "/usr/local/lib/python3.10/dist-packages/yarl/_url.py", line 179, in __new__
raise TypeError("Constructor parameter should be str")
TypeError: Constructor parameter should be str
|
Use with the new code or change your env file hgimg2text to HGIMG2TEXT its already changed in the example file |
I started the bot.
Sent the random picture from my gallery
Got this error in terminal:
Error processing file https://api.telegram.org/file/(MY BOT TOKEN)/photos/file_5.jpg: (1, 'Error opening data file /usr/share/tesseract-ocr/4.00/tessdata/script/Devanagari.traineddata Please make sure the TESSDATA_PREFIX environment variable is set to your "tessdata" directory. Failed loading language 'script/Devanagari' Tesseract couldn't load any languages! Could not initialize tesseract.')
2023-06-20 17:20:24,208 (async_telebot.py:542 MainThread) ERROR - TeleBot: "Constructor parameter should be str"
I downloaded Devanagari.traineddata, put into /usr/share/tesseract-ocr/4.00/tessdata/
Changed main.py:31 to -> ocr = botocr.OCR(config=" --psm 3 --oem 3 -l Devanagari")
Got this error in terminal:
2023-06-20 17:47:14,734 (async_telebot.py:542 MainThread) ERROR - TeleBot: "Constructor parameter should be str"
How to fix it?
The text was updated successfully, but these errors were encountered: