dify icon indicating copy to clipboard operation
dify copied to clipboard

"Output Anomalies in DIFY When Handling Long Content: Issues with Text Repetition and Formatting"

Open mengdahuang opened this issue 1 year ago • 7 comments

Self Checks

  • [X] This is only for bug report, if you would like to ask a question, please head to Discussions.
  • [X] I have searched for existing issues search for existing issues, including closed ones.
  • [X] I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • [X] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • [X] Please do not modify this template :) and fill in all the required fields.

Dify version

0.6.16

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

Dear DIFY Team,

Fault Description: When DIFY outputs content, if the content is too long, the text and formatting at the end become uncontrollable (such as repetition, garbled text, excessive spacing, and other anomalies). iShot_2024-08-08_09 52 56 iShot_2024-08-08_09 50 45

Reproduction Steps: Initially, I suspected it was an issue with the capabilities of the gpt-4o model. However, when I imported the same knowledge document into both DIFY and FASTGPT and requested both to output all content from the knowledge base (or a specific point, as long as there is enough content), I found that: FASTGPT's output was normal, but DIFY's output was abnormal. iShot_2024-08-08_09 46 00

So, I conducted a second round of testing:

I integrated the normal output from FASTGPT as an API into DIFY's workflow (using DIFY's HTTP request module). I disabled DIFY's own knowledge base and directly used the FASTGPT API via HTTP requests. At this point, I found that the FASTGPT API output was normal, but the content transmitted to DIFY still exhibited the aforementioned anomalies. iShot_2024-08-08_09 54 52


"I have to add that this is not just a web rendering issue. By using the workflow mentioned above, I published DIFY as an application and queried it through the DIFY API with the same long text content. I also encountered formatting issues, typos, and other anomalies as described above."

Look forward to your reply, thank you!

✔️ Expected Behavior

No response

❌ Actual Behavior

No response

mengdahuang avatar Aug 08 '24 01:08 mengdahuang

To resolve the issue of DIFY outputting long content with text repetition, garbled text, excessive spacing, and other anomalies in version 0.6.16 when self-hosted using Docker, you should ensure that your Docker setup and environment variables are correctly configured. Follow these steps:

  1. Check Docker and Docker Compose Installation: Ensure that Docker and Docker Compose are properly installed on your machine.

    docker --version
    docker-compose --version
    
  2. Update Environment Variables: Copy the example environment file and update it with your specific configurations.

    cd docker
    cp .env.example .env
    

    Edit the .env file to match your deployment needs.

  3. Run Docker Compose: Start the Dify server using Docker Compose.

    docker compose up -d
    
  4. Access Dify Console: After running the Docker Compose command, access the Dify console in your browser to complete the installation.

    http://localhost/install
    
  5. Custom Configuration: If you need custom configurations, update the docker-compose.yaml file and the .env file accordingly. After making changes, restart the Docker Compose.

    docker-compose up -d
    
  6. Check for Updates and Patches: Ensure you are using the latest version of Dify and check for any patches or updates that might address the issue [1].

Additionally, Dify includes observability features that allow you to monitor and analyze application logs and performance over time. This can help identify the root cause of issues such as text repetition, garbled text, and excessive spacing [2].

To continue talking to Dosu, mention @dosu.

dosubot[bot] avatar Aug 08 '24 01:08 dosubot[bot]

I also had same issue as well.

xrenaissance avatar Aug 08 '24 02:08 xrenaissance

I also had same issue as well.

Looks like I've found a new friend on this issue!

mengdahuang avatar Aug 08 '24 03:08 mengdahuang

I also had same issue as well.

Looks like I've found a new friend on this issue!

Friend +1

Phillee80 avatar Aug 09 '24 05:08 Phillee80

Dear Dify Team,

any update on this issue?

Thanks With Best Regards,

mengdahuang avatar Aug 12 '24 03:08 mengdahuang

@takatost Hi, cloud you please help to check this issue ? thanks a lot.

mengdahuang avatar Sep 19 '24 08:09 mengdahuang

Hi, we are unable to reproduce this situation. "Reproduction steps: Initially, I suspected it was an issue with the capabilities of the gpt-4o model. However, when I imported the same knowledge document into DIFY and FASTGPT and requested both to output all content from the knowledge base (or specific points as long as there is enough content)" I'm not sure if I've missed some details in this step; I hope you can provide further clarification or DSL.

Yevanchen avatar Oct 23 '24 03:10 Yevanchen

Hi, we are unable to reproduce this situation. "Reproduction steps: Initially, I suspected it was an issue with the capabilities of the gpt-4o model. However, when I imported the same knowledge document into DIFY and FASTGPT and requested both to output all content from the knowledge base (or specific points as long as there is enough content)" I'm not sure if I've missed some details in this step; I hope you can provide further clarification or DSL.

Hi, Thanks for your reply.

This is unrelated to DSL; it's a matter of the length of the knowledge base content. As long as the response content related to your question is too long, this issue will arise. You can test it out. For example, if you create a knowledge base question about internal discounts at company xxx and then paste a relatively long piece of text as an answer, just ensure that when the question hits, the response is that entire paragraph—if it's long enough, it will exhibit the situation shown in the previous screenshot. However, with the same content and model on fastgpt, this problem does not occur, so it’s not related to the model.

mengdahuang avatar Oct 28 '24 03:10 mengdahuang

无标题 这个问题存在,见上传的图片。请问如何解决。我们的版本是0.9.2

wxchuhy avatar Nov 27 '24 14:11 wxchuhy

Hi, @mengdahuang. I'm Dosu, and I'm helping the Dify team manage their backlog. I'm marking this issue as stale.

Issue Summary

  • Dify produces output anomalies like text repetition and garbled text with long content.
  • The issue does not occur with FASTGPT.
  • I suggested checking Docker setup and environment configurations.
  • Other users, including xrenaissance and Phillee80, reported similar issues.
  • Yevanchen from the Dify team couldn't reproduce the issue and asked for more details.

Next Steps

  • Please confirm if this issue is still relevant with the latest version of Dify by commenting here.
  • If there is no further activity, this issue will be automatically closed in 15 days.

Thank you for your understanding and contribution!

dosubot[bot] avatar Dec 28 '24 16:12 dosubot[bot]