argilla-io / argilla

Argilla is a collaboration tool for AI engineers and domain experts to build high-quality datasets
https://docs.argilla.io
Apache License 2.0
4k stars 378 forks source link

[BUG-UI/UX] When use_markdown=True, content will be displayed twice. #5629

Closed Ignoramus0817 closed 4 weeks ago

Ignoramus0817 commented 4 weeks ago

Describe the bug

When set use_markdown=True to rg.TextField, corresponding records will be displayed twice on the page. The first one is rendered and the second is raw text.

To Reproduce

Here is a short code snippet to reproduce the bug.

import argilla as rg

client = rg.Argilla(
    api_url="<api_url>", api_key="<api_key>")

settings = rg.Settings(
    guidelines="These are some guidelines.",
    fields=[
        rg.TextField(
            name="text", title="text", use_markdown=True
        ),
    ],
    questions=[
        rg.LabelQuestion(
            name="label",
            labels=["label_1", "label_2", "label_3"]
        ),
    ],
    metadata=[
        rg.TermsMetadataProperty(
            name="id",
        )
    ]
)

dataset = rg.Dataset(
    name="sample_dataset_0",
    workspace="sft",
    settings=settings,
)

dataset.create()

dataset = client.datasets(name="sample_dataset_0")
records = [
    rg.Record(
        fields={
            "text": "Do you need **oxygen** to breathe?",
        },
        metadata={"id": "0"},
    ),
    rg.Record(
        fields={
            "text": "What is the boiling point of water?",
        },
        metadata={"id": "1"},
    ),
]

dataset.records.log(records)

Expected behavior

When using markdown, content should only be displayed once, rendered.

Screenshots

screenshots

Environment (please complete the following information):

leiyre commented 4 weeks ago

Hi @Ignoramus0817! Thanks for reporting the bug. It was already fixed in this PR, which is going in the next release

Ignoramus0817 commented 4 weeks ago

Got it. Thanks for replying so fast.