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

Double Puncuation #377

Open
jimmygitctrl opened this issue Nov 10, 2023 · 2 comments
Open

Double Puncuation #377

jimmygitctrl opened this issue Nov 10, 2023 · 2 comments
Labels

Comments

@jimmygitctrl
Copy link

Responses in the Web App contain double punctuation.

Example:
image

In the Azure Open AI Studio Chat Playground, responses do NOT contain the double punctuation. For example:
image

Happens for all punctuation types from what I can see, not just periods.

@wcwong
Copy link

wcwong commented Nov 22, 2023

@sarah-widder @iseabock The problem appears to be in app.py in stream_without_data() in this code:

def stream_without_data(response, history_metadata={}):
    responseText = ""
    for line in response:

responseText should be inside the loop and not outside. What appears to be happening is deltaText is returning 'None' at the end of the streamed output and the value for responseText is not being changed, and so the value from the last loop is being reused and so you get the duplicate.

If you wanted to be paranoid, it may make sense to explicitly initialize both reponseText and deltaText at the start of the loop, e.g.

def stream_without_data(response, history_metadata={}):
    for line in response:
        responseText = ""
        deltaText = ""

Copy link

This issue is stale because it has been open for 30 days with no activity.

@github-actions github-actions bot added the stale label Feb 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants