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

Incorrect numbering in ordered lists #22

Open
ansysic opened this issue Mar 29, 2023 · 7 comments
Open

Incorrect numbering in ordered lists #22

ansysic opened this issue Mar 29, 2023 · 7 comments
Labels
bug Something isn't working

Comments

@ansysic
Copy link

ansysic commented Mar 29, 2023

Numbered lists don't go higher than 1. Also spacing between is off.

Example:
image

@Shackless Shackless added the bug Something isn't working label Mar 29, 2023
@Shackless
Copy link
Contributor

Shackless commented Mar 29, 2023

@ansysic Could you please share this chat and paste the share URL here for easier debugging?

Looks like the completion markdown is parsed as a bunch of ordered lists resulting in a DOM structure like this

<ol>
   <li>Point</li>
</ol>
<ol>
   <li>Point</li>
</ol>

That would explain the large spacing and the numbering.

Does it also happen if you rephrase your prompt as "Give me a list of ..." or add that to the context like here: https://slickgpt.vercel.app/shared/flat-poor-train

@Shackless Shackless removed the bug Something isn't working label Mar 29, 2023
@ansysic
Copy link
Author

ansysic commented Mar 29, 2023

Unfortunately I don't have sharing features enabled. I could however reproduce it.

image

Source code of the screenshot above:

<div class="md:place-self-start svelte-1lw6cj4">
    <div class="grid px-5 py-2 rounded-2xl svelte-1lw6cj4 variant-ghost-secondary rounded-tl-none">
        <div class="flex justify-between mb-1 svelte-1lw6cj4"><span class="font-bold svelte-1lw6cj4">AI:</span>
            <div class="flex items-center text-xs text-slate-500"><svg xmlns="http://www.w3.org/2000/svg" fill="none"
                    viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-4 h-4">
                    <path stroke-linecap="round" stroke-linejoin="round"
                        d="M20.25 6.375c0 2.278-3.694 4.125-8.25 4.125S3.75 8.653 3.75 6.375m16.5 0c0-2.278-3.694-4.125-8.25-4.125S3.75 4.097 3.75 6.375m16.5 0v11.25c0 2.278-3.694 4.125-8.25 4.125s-8.25-1.847-8.25-4.125V6.375m16.5 0v3.75m-16.5-3.75v3.75m16.5 0v3.75C20.25 16.153 16.556 18 12 18s-8.25-1.847-8.25-4.125v-3.75m16.5 0c0 2.278-3.694 4.125-8.25 4.125s-8.25-1.847-8.25-4.125">
                    </path>
                </svg> <span>360</span></div>
            <div class="text-xs text-center card variant-filled p-2 whitespace-nowrap shadow-xl"
                data-popup="tokenTooltip">Approximate token cost <div class="arrow variant-filled"></div>
            </div>
        </div>
        <div class="svelte-1lw6cj4">
            <ol>
                <li>Plan ahead: London is a busy city and popular attractions can book out quickly, so it's best to plan
                    ahead and book tickets and accommodation in advance.</li>
            </ol><br>
            <ol>
                <li>Use public transport: London has a great public transport system that includes the tube, buses, and
                    trains. Using public transport is the most efficient way to get around and get the most out of your
                    trip.</li>
            </ol><br>
            <ol>
                <li>Dress for the weather: London is known for its unpredictable weather, so be prepared with layers and
                    a water-proof jacket.</li>
            </ol><br>
            <ol>
                <li>Be polite: The British are known for their politeness and courtesy, so make sure to be respectful of
                    locals and their culture.</li>
            </ol><br>
            <ol>
                <li>Watch out for traffic: London has many busy roads, so make sure to be careful when crossing the
                    street.</li>
            </ol><br>
            <ol>
                <li>Explore the city's neighborhoods: London is made up of many unique neighborhoods, each with its own
                    flavor and attractions. Take the time to explore a few different areas to get a real sense of the
                    city.</li>
            </ol><br>
            <ol>
                <li>Try the local cuisine: London has a rich culinary scene that includes both traditional British fare
                    and food from around the world. Make sure to try some of the local specialties!</li>
            </ol><br>
            <ol>
                <li>Stay safe: As with any big city, it's important to stay aware of your surroundings and take
                    precautions to stay safe, especially when travelling alone or at night.</li>
            </ol><br>
            <ol>
                <li>Visit the museums: London is home to some of the world's best museums, and many of them are free to
                    enter. Make sure to visit a few during your trip.</li>
            </ol><br>
            <ol>
                <li>Have fun!: London is an exciting city with plenty to do and see. Enjoy your time there and make the
                    most of your visit!</li>
            </ol>
        </div>
    </div>
</div>

@ansysic
Copy link
Author

ansysic commented Mar 29, 2023

It does not happen when asking for a list specifically, which is good.
image

@Shackless
Copy link
Contributor

Thanks for the clarification. The problem is that there are some linebreaks in the completion that our Markdown parser (mis)interprets as different list entities. This is a bit fiddly to fix and might have side effects on other completions. Because we have a workaround (asking for a list explicitly), I'd also consider this a low priority issue. I'll leave the issue open in case somebody wants to give it a shot and for documentation purposes.

@Shackless Shackless added the bug Something isn't working label Mar 30, 2023
@jondcoleman
Copy link

It seems to sometimes still do this when I ask for a list.
image

@Shackless
Copy link
Contributor

Shackless commented Apr 25, 2023

@jondcoleman
Now that there is a "pipe" in place (see #44 (comment)), one could try to reformat the broken lists. My guess is that the markdown list items in these error cases contain line breaks that lead to several lists being rendered by our markdown parser. I'm currently pretty busy and would need a couple of days before I could tackle that. Do you want to give it a shot? Contributions are always very welcome.

@GrAndAG
Copy link

GrAndAG commented May 23, 2024

It seems it simply does not respect the numbers of the list items and always renders them as "1".
I noticed that when I asked AI to continue and in the anaswer the list started not from "1" (the list contunues the one from previous answer). Or if list items has some non-plain text blocks (code blocks, for example).

For example, I have the reduced answer (shortened the text and removed code blocks content, but keep \n in place) from AI (I'm using SlickGPT with local LM_Studio server, so the response below retreived from its console):

{
  "role": "assistant",
  "content": "Here are a few more ways to test:\n\n4. **Scan-based testing**: In this approach...\n\nExample:\n```...```\n5. **Boundary-scan testing**: In this approach...\n\nExample:\n```...```\n6. **Structural testing**: In this approach...\n\nExample:\n```...```\nThese are just a few more examples...."
}

And this response is rendered as 1... 1... 1. list instead of 4... 5... 6.

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

No branches or pull requests

4 participants