Kav-K / GPTDiscord

A robust, all-in-one GPT interface for Discord. ChatGPT-style conversations, image generation, AI-moderation, custom indexes/knowledgebase, youtube summarizer, and more!
MIT License
1.81k stars 305 forks source link

[BUG] Retry requests fail for image optimizer #129

Closed Kav-K closed 1 year ago

Kav-K commented 1 year ago

Describe the bug Retry requests fail for image optimize requests

Token indices sequence length is longer than the specified maximum sequence length for this model (3784 > 1024). Running this sequence through the model will result in indexing errors
Ignoring exception in view <OptimizeView timeout=None children=2> for item <RedoButton style=<ButtonStyle.danger: 4> url=None disabled=False label='Retry' emoji=None row=None>:
Traceback (most recent call last):
  File "/home/gptbotopenai/services/text_service.py", line 278, in encapsulated_send
    temp_override=overrides.temperature,
AttributeError: 'NoneType' object has no attribute 'temperature'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.9/dist-packages/discord/ui/view.py", line 414, in _scheduled_task
    await item.callback(interaction)
  File "/home/gptbotopenai/cogs/prompt_optimizer_cog.py", line 263, in callback
    await TextService.encapsulated_send(
  File "/home/gptbotopenai/services/text_service.py", line 508, in encapsulated_send
    await ctx.reply(embed=embed)
AttributeError: 'ApplicationContext' object has no attribute 'reply'
Ignoring exception in view <OptimizeView timeout=None children=2> for item <RedoButton style=<ButtonStyle.danger: 4> url=None disabled=False label='Retry' emoji=None row=None>:
Traceback (most recent call last):
  File "/home/gptbotopenai/services/text_service.py", line 278, in encapsulated_send
    temp_override=overrides.temperature,
AttributeError: 'NoneType' object has no attribute 'temperature'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.9/dist-packages/discord/ui/view.py", line 414, in _scheduled_task
    await item.callback(interaction)
  File "/home/gptbotopenai/cogs/prompt_optimizer_cog.py", line 263, in callback
    await TextService.encapsulated_send(
  File "/home/gptbotopenai/services/text_service.py", line 508, in encapsulated_send
    await ctx.reply(embed=embed)
AttributeError: 'ApplicationContext' object has no attribute 'reply'

To Reproduce do a /dalle optimize request and then retry it

Notes: I think it's just some stupid error some tiny thing

Kav-K commented 1 year ago

Fixed!