Skip to content

Instantly share code, notes, and snippets.

@billmetangmo
Created August 4, 2023 23:30
Show Gist options
  • Select an option

  • Save billmetangmo/b1ed646eb2df4437e93675892f5f3ff5 to your computer and use it in GitHub Desktop.

Select an option

Save billmetangmo/b1ed646eb2df4437e93675892f5f3ff5 to your computer and use it in GitHub Desktop.
Label output LLM
import argilla as rg
from argilla.client.feedback.schemas.records import ResponseSchema, SuggestionSchema, ValueSchema
rg.init(
api_url="http://localhost:6900",
api_key="admin.apikey"
)
dataset = rg.FeedbackDataset(
guidelines="Add some guidelines for the annotation team here.",
fields=[
rg.TextField(name="prompt", title="Human prompt"),
rg.TextField(name="output", title="Generated output", use_markdown=True)
],
questions =[
rg.RatingQuestion(
name="rating",
title="Rate the quality of the response:",
description="1 = very bad - 5= very good",
required=True,
values=[1,2,3,4,5]
),
rg.TextQuestion(
name="corrected-text",
title="Provide a correction to the response:",
required=False,
use_markdown=True
)
]
)
record = rg.FeedbackRecord(
fields={"prompt": "This is the first record", "output": "positive"}
)
#rg.log(record,"my_dataset",workspace="admin")
dataset.add_records(record)
dataset.push_to_argilla(name="my_dataset", workspace="admin")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment