Giter Club home page Giter Club logo

Comments (6)

noes14155 avatar noes14155 commented on June 16, 2024

Yes imaginepy API is down. I am looking for an alternative

from telegrambot-with-gpt.

noes14155 avatar noes14155 commented on June 16, 2024

Fixed

from telegrambot-with-gpt.

vasmarfas avatar vasmarfas commented on June 16, 2024

If i send picture to bot, i get this error in terminal
Error processing file https://api.telegram.org/file/bot5337896746:AAETEwCAfQPmj_T594ldwp1kxDkA27Xc7ew/photos/file_0.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.')
ERROR:asyncio:Task exception was never retrieved
future: <Task finished name='Task-10' 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 277, in imageaudio_handler
text = await bm.generate_imagecaption(image_url,HG_TOKEN)
File "/home/ubuntu/Telegrambot-with-GPT4free/bot/botmedia.py", line 25, in generate_imagecaption
async with session.get(url) as resp1, 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

from telegrambot-with-gpt.

noes14155 avatar noes14155 commented on June 16, 2024

Fixed. pronlem from wrong variable name

from telegrambot-with-gpt.

vasmarfas avatar vasmarfas commented on June 16, 2024

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

from telegrambot-with-gpt.

noes14155 avatar noes14155 commented on June 16, 2024

Use with the new code or change your env file hgimg2text to HGIMG2TEXT its already changed in the example file

from telegrambot-with-gpt.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.