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

🐛 Bug Report: Empty response in the conversation after finishing streaming #944

Open
2 tasks done
starkgate opened this issue May 10, 2024 · 1 comment
Open
2 tasks done
Assignees

Comments

@starkgate
Copy link

starkgate commented May 10, 2024

📜 Description

When asking a question, the LLM's response streams in as it should, then disappears from the conversation once it is finished. It reappears if the page is refreshed.

👟 Reproduction steps

I am running DocsGPT 0.9.0 locally (./setup.sh with option 2). The environment is configured to use llama-cpp with huggingface_sentence-transformers/all-mpnet-base-v2 embeddings. To reproduce the bug, simply ask a question with this environment.

👍 Expected behavior

The response should remain on screen.

👎 Actual Behavior with Screenshots

Here is a recording of the issue: https://i.imgur.com/MBo3xtV.gif

💻 Operating system

Windows

What browsers are you seeing the problem on?

Firefox, Chrome

🤖 What development environment are you experiencing this bug on?

Docker

🔒 Did you set the correct environment variables in the right path? List the environment variable names (not values please!)

CELERY_BROKER_URL
CELERY_RESULT_BACKEND
EMBEDDINGS_NAME
FLASK_APP
FLASK_DEBUG
LLM_NAME
VITE_API_STREAMING

📃 Provide any additional context for the Bug.

The bug seems to occur when the token sent by the LLM is an empty string. In llama-cpp, the last token seems to always be an empty string. This causes the frontend to recognize the string as empty in

, which in turn causes the code to enter the else part of the statement, which returns an empty response.

The fix is simple, we can check specifically for undefined:
image

📖 Relevant log output

No response

👀 Have you spent some time to check if this bug has been raised before?

  • I checked and didn't find similar issue

🔗 Are you willing to submit PR?

Yes, I am willing to submit a PR!

🧑‍⚖️ Code of Conduct

  • I agree to follow this project's Code of Conduct
@dartpain
Copy link
Contributor

Nice catch, thank you!

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

No branches or pull requests

2 participants