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

Too Many Message Exception Error #275

Open
Aravind4525 opened this issue Jan 21, 2025 · 8 comments
Open

Too Many Message Exception Error #275

Aravind4525 opened this issue Jan 21, 2025 · 8 comments
Labels
bug bug!

Comments

@Aravind4525
Copy link

hugchat.exceptions.ChatError: Failed to parse response: {"message":"You are sending too many messages. Try again later."}

Now hugchat Model is receiving this error

@Aravind4525 Aravind4525 added the bug bug! label Jan 21, 2025
@Aravind4525
Copy link
Author

Every Model is getting this error

Image

@helqasem
Copy link

@Soulter Looks like there has been a server-side issue and HC isn't closing off the event streams with "finalAnswer". I tested in the HC UI and it's the same:

{"type":"stream","token":"1\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"}
{"type":"status","status":"keepAlive"}
{"type":"stream","token":"!\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"}

I created a convo in the REPL and sent a simple "Hello Again". The result:

>>> for res in msg:
...     print(res)  # Process each streamed response
... else:
...     if msg.done() == MessageStatus.REJECTED:
...         raise msg.error
...
{'type': 'stream', 'token': 'It'}
{'type': 'stream', 'token': "'s"}
{'type': 'stream', 'token': ' nice'}
{'type': 'stream', 'token': ' to'}
{'type': 'stream', 'token': ' see'}
{'type': 'stream', 'token': ' you'}
{'type': 'stream', 'token': ' again'}
{'type': 'stream', 'token': '.'}
{'type': 'stream', 'token': ' Is'}
{'type': 'stream', 'token': ' there'}
{'type': 'stream', 'token': ' something'}
{'type': 'stream', 'token': ' I'}
{'type': 'stream', 'token': ' can'}
{'type': 'stream', 'token': ' help'}
{'type': 'stream', 'token': ' you'}
{'type': 'stream', 'token': ' with'}
{'type': 'stream', 'token': ' or'}
{'type': 'stream', 'token': ' would'}
{'type': 'stream', 'token': ' you'}
{'type': 'stream', 'token': ' like'}
{'type': 'stream', 'token': ' to'}
{'type': 'stream', 'token': ' chat'}
{'type': 'stream', 'token': '?'}
{'type': 'stream', 'token': 'It'}
{'type': 'stream', 'token': "'s"}
{'type': 'stream', 'token': ' nice'}
{'type': 'stream', 'token': ' to'}
{'type': 'stream', 'token': ' see'}
{'type': 'stream', 'token': ' you'}
{'type': 'stream', 'token': ' again'}
{'type': 'stream', 'token': '.'}
{'type': 'stream', 'token': ' Is'}
{'type': 'stream', 'token': ' there'}
{'type': 'stream', 'token': ' something'}
{'type': 'stream', 'token': ' I'}
{'type': 'stream', 'token': ' can'}
{'type': 'stream', 'token': ' help'}
{'type': 'stream', 'token': ' you'}
{'type': 'stream', 'token': ' with'}
{'type': 'stream', 'token': ' or'}
{'type': 'stream', 'token': ' would'}
{'type': 'stream', 'token': ' you'}
{'type': 'stream', 'token': ' like'}
{'type': 'stream', 'token': ' to'}
{'type': 'stream', 'token': ' chat'}
{'type': 'stream', 'token': '?'}
{'type': 'stream', 'token': 'It'}
{'type': 'stream', 'token': "'s"}
{'type': 'stream', 'token': ' nice'}
{'type': 'stream', 'token': ' to'}
{'type': 'stream', 'token': ' see'}
{'type': 'stream', 'token': ' you'}
{'type': 'stream', 'token': ' again'}
{'type': 'stream', 'token': '.'}
{'type': 'stream', 'token': ' Is'}
{'type': 'stream', 'token': ' there'}
{'type': 'stream', 'token': ' something'}

...etc...

As there is no "finalAnswer" event in the stream.. the Message generator re-sends "Hello Again" and it loops until message limit thresholds are hit. Hence.. "You are sending too many messages" Error.

Not sure there is an easy fix for this unless HC fix the event stream closures.

@Aravind4525
Copy link
Author

When it will be fixed

@Soulter
Copy link
Owner

Soulter commented Jan 22, 2025

Thanks for sharing the solution! @helqasem I will fix it soon..

@Soulter
Copy link
Owner

Soulter commented Jan 22, 2025

I feel like they used the time difference between two data returns to determine whether SSE should be disconnected... wrong

Image

Image

And there is reason to speculate that HF changed this rule to introduce real-time capability like Google Gemini 🤔 I'm not sure

@Soulter
Copy link
Owner

Soulter commented Jan 22, 2025

Pushed a patch that can fix this error.

@Aravind4525
Copy link
Author

But still receives same error

@Aravind4525
Copy link
Author

Thanks, Now it is working

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug bug!
Projects
None yet
Development

No branches or pull requests

3 participants