Skip to content

Commit

Permalink
[BUGFIX] docs: Set quickstart image tag fixed to 2.0 rc (#5077)
Browse files Browse the repository at this point in the history
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
frascuchon and pre-commit-ci[bot] authored Jun 20, 2024
1 parent 39779c1 commit d5f1e23
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 22 deletions.
2 changes: 1 addition & 1 deletion argilla/docs/getting_started/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ If you have already deployed Argilla Server, you can skip this step. Otherwise,
* Locally with Docker.

```console
docker run -d --name quickstart -p 6900:6900 argilla/argilla-quickstart:latest
docker run -d --name quickstart -p 6900:6900 argilla/argilla-quickstart:v2.0.0rc1
```

## Connect to the Argilla server
Expand Down
2 changes: 1 addition & 1 deletion argilla/docs/getting_started/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ If you have already deployed Argilla Server, you can skip this step. Otherwise,
* Locally using Docker.

```console
docker run -d --name quickstart -p 6900:6900 argilla/argilla-quickstart:latest
docker run -d --name quickstart -p 6900:6900 argilla/argilla-quickstart:v2.0.0rc1
```

### Connect to the Argilla server
Expand Down
38 changes: 19 additions & 19 deletions argilla/docs/how_to_guides/migrate_from_legacy_datasets.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Migrate your legacy datasets to Argilla V2

This guide will help you migrate task specific datasets to Argilla V2. These do not include the `FeedbackDataset` which is just an interim naming convention for the latest extensible dataset. Task specific datasets are datasets that are used for a specific task, such as text classification, token classification, etc. If you would like to learn about the backstory of SDK this migration, please refer to the [SDK migration blog post](https://argilla.io/blog/introducing-argilla-new-sdk/).
This guide will help you migrate task specific datasets to Argilla V2. These do not include the `FeedbackDataset` which is just an interim naming convention for the latest extensible dataset. Task specific datasets are datasets that are used for a specific task, such as text classification, token classification, etc. If you would like to learn about the backstory of SDK this migration, please refer to the [SDK migration blog post](https://argilla.io/blog/introducing-argilla-new-sdk/).

!!! note
Legacy Datasets include: `DatasetForTextClassification`, `DatasetForTokenClassification`, and `DatasetForText2Text`.
Expand All @@ -13,11 +13,11 @@ To follow this guide, you will need to have the following prerequisites:
- An argilla >=1.29 server instance running. If you don't have one, you can create one by following the [Argilla installation guide](../../getting_started/installation.md).
- The `argilla` sdk package installed in your environment.

If your current legacy datasets are on a server with Argilla release after 1.29, you could chose to recreate your legacy datasets as new datasets on the same server. You could then upgrade the server to Argilla 2.0 and carry on working their. Your legacy datasets will not be visible on the new server, but they will remain in storage layers if you need to access them.
If your current legacy datasets are on a server with Argilla release after 1.29, you could chose to recreate your legacy datasets as new datasets on the same server. You could then upgrade the server to Argilla 2.0 and carry on working their. Your legacy datasets will not be visible on the new server, but they will remain in storage layers if you need to access them.

## Steps

The guide will take you through three steps:
The guide will take you through three steps:

1. **Retrieve the legacy dataset** from the Argilla V1 server using the new `argilla` package.
2. **Define the new dataset** in the Argilla V2 format.
Expand Down Expand Up @@ -101,7 +101,7 @@ dataset.create()

```python
dataset = client.datasets(name=dataset_name)

if dataset.exists():
dataset.delete()
```
Expand All @@ -119,16 +119,16 @@ Here are a set of example functions to convert the records for single-label and
""" This function maps a text classification record dictionary to the new Argilla record."""
suggestions = []
responses = []

if prediction := data.get("prediction"):
label, score = prediction[0].values()
agent = data["prediction_agent"]
suggestions.append(rg.Suggestion(question_name="label", value=label, score=score, agent=agent))

if annotation := data.get("annotation"):
user_id = users_by_name.get(data["annotation_agent"], current_user).id
responses.append(rg.Response(question_name="label", value=annotation, user_id=user_id))

vectors = (data.get("vectors") or {})
return rg.Record(
id=data["id"],
Expand All @@ -149,16 +149,16 @@ Here are a set of example functions to convert the records for single-label and
""" This function maps a text classification record dictionary to the new Argilla record."""
suggestions = []
responses = []

if prediction := data.get("prediction"):
labels, scores = zip(*[(pred["label"], pred["score"]) for pred in prediction])
agent = data["prediction_agent"]
suggestions.append(rg.Suggestion(question_name="labels", value=labels, score=scores, agent=agent))

if annotation := data.get("annotation"):
user_id = users_by_name.get(data["annotation_agent"], current_user).id
responses.append(rg.Response(question_name="label", value=annotation, user_id=user_id))

vectors = data.get("vectors") or {}
return rg.Record(
id=data["id"],
Expand All @@ -171,24 +171,24 @@ Here are a set of example functions to convert the records for single-label and
responses=responses,
)
```

=== "For token classification"

```python
def map_to_record_for_span(data: dict, users_by_name: dict, current_user: rg.User) -> rg.Record:
""" This function maps a token classification record dictionary to the new Argilla record."""
suggestions = []
responses = []

if prediction := data.get("prediction"):
scores = [span["score"] for span in prediction]
agent = data["prediction_agent"]
suggestions.append(rg.Suggestion(question_name="spans", value=prediction, score=scores, agent=agent))

if annotation := data.get("annotation"):
user_id = users_by_name.get(data["annotation_agent"], current_user).id
responses.append(rg.Response(question_name="spans", value=annotation, user_id=user_id))

vectors = data.get("vectors") or {}
return rg.Record(
id=data["id"],
Expand All @@ -202,27 +202,27 @@ Here are a set of example functions to convert the records for single-label and
responses=responses,
)
```

=== "For Text generation"

```python
def map_to_record_for_text_generation(data: dict, users_by_name: dict, current_user: rg.User) -> rg.Record:
""" This function maps a text2text record dictionary to the new Argilla record."""
suggestions = []
responses = []

if prediction := data.get("prediction"):
first = prediction[0]
agent = data["prediction_agent"]
suggestions.append(
rg.Suggestion(question_name="text_generation", value=first["text"], score=first["score"], agent=agent)
)

if annotation := data.get("annotation"):
# From data[annotation]
user_id = users_by_name.get(data["annotation_agent"], current_user).id
responses.append(rg.Response(question_name="text_generation", value=annotation, user_id=user_id))

vectors = (data.get("vectors") or {})
return rg.Record(
id=data["id"],
Expand All @@ -240,7 +240,7 @@ Here are a set of example functions to convert the records for single-label and
The functions above depend on the `users_by_name` dictionary and the `current_user` object to assign responses to users, we need to load the existing users. You can retrieve the users from the Argilla V2 server and the current user as follows:

```python
# For
# For
users_by_name = {user.username: user for user in client.users}
current_user = client.me
```
Expand Down
2 changes: 1 addition & 1 deletion argilla/docs/tutorials/text_classification.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"If you have already deployed Argilla Server, you can skip this step. Otherwise, you can quickly deploy it in two different ways:\n",
"\n",
"* Remotely using a [HF Space](https://huggingface.co/new-space?template=argilla/argilla-template-space). ⚠️ If persistent storage is not enabled, you will lose your data when the server is stopped.\n",
"* Locally using Docker: `docker run -d --name quickstart -p 6900:6900 argilla/argilla-quickstart:latest`"
"* Locally using Docker: `docker run -d --name quickstart -p 6900:6900 argilla/argilla-quickstart:v2.0.0rc1`"
]
},
{
Expand Down

0 comments on commit d5f1e23

Please sign in to comment.