From 907ba35a6545ccd5fc111a67e9c877776fb076fc Mon Sep 17 00:00:00 2001 From: Sara Han <127759186+sdiazlor@users.noreply.github.com> Date: Mon, 4 Nov 2024 11:16:09 +0100 Subject: [PATCH 01/16] docs: fix small issues (#5665) # Description Closes # **Type of change** - Bug fix (non-breaking change which fixes an issue) - New feature (non-breaking change which adds functionality) - Breaking change (fix or feature that would cause existing functionality to not work as expected) - Refactor (change restructuring the codebase without changing functionality) - Improvement (change adding some improvement to an existing functionality) - Documentation update **How Has This Been Tested** **Checklist** - I added relevant documentation - I followed the style guidelines of this project - I did a self-review of my code - I made corresponding changes to the documentation - I confirm My changes generate no new warnings - I have added tests that prove my fix is effective or that my feature works - I have added relevant notes to the CHANGELOG.md file (See https://keepachangelog.com/) --- argilla/README.md | 2 +- argilla/docs/getting_started/faq.md | 8 ++++++-- argilla/docs/getting_started/quickstart.md | 9 +++------ argilla/docs/how_to_guides/annotate.md | 4 ++-- argilla/docs/how_to_guides/custom_fields.md | 2 +- argilla/docs/index.md | 2 +- argilla/docs/reference/argilla/client.md | 3 +++ 7 files changed, 17 insertions(+), 13 deletions(-) diff --git a/argilla/README.md b/argilla/README.md index 74d36115a8..baf19dc26b 100644 --- a/argilla/README.md +++ b/argilla/README.md @@ -75,7 +75,7 @@ The community uses Argilla to create amazing open-source [datasets](https://hugg AI teams from companies like [the Red Cross](https://510.global/), [Loris.ai](https://loris.ai/) and [Prolific](https://www.prolific.com/) use Argilla to improve the quality and efficiency of AI projects. They shared their experiences in our [AI community meetup](https://lu.ma/embed-checkout/evt-IQtRiSuXZCIW6FB). - AI for good: [the Red Cross presentation](https://youtu.be/ZsCqrAhzkFU?feature=shared) showcases how the Red Cross domain experts and AI team collaborated by classifying and redirecting requests from refugees of the Ukrainian crisis to streamline the support processes of the Red Cross. -- Customer support: during [the Loris meetup](https://youtu.be/jWrtgf2w4VU?feature=shared) they showed how their AI team uses unsupervised and few-shot contrastive learning to help them quickly validate and gain labelled samples for a huge amount of multi-label classifiers. +- Customer support: during [the Loris meetup](https://youtu.be/jWrtgf2w4VU?feature=shared) they showed how their AI team uses unsupervised and few-shot contrastive learning to help them quickly validate and gain labeled samples for a huge amount of multi-label classifiers. - Research studies: [the showcase from Prolific](https://youtu.be/ePDlhIxnuAs?feature=shared) announced their integration with our platform. They use it to actively distribute data collection projects among their annotating workforce. This allows Prolific to quickly and efficiently collect high-quality data for research studies. ## 👨‍💻 Getting started diff --git a/argilla/docs/getting_started/faq.md b/argilla/docs/getting_started/faq.md index e4076a04c3..7f1c869c9b 100644 --- a/argilla/docs/getting_started/faq.md +++ b/argilla/docs/getting_started/faq.md @@ -11,11 +11,15 @@ hide: toc ??? Question "Does Argilla cost money?" - No. Argilla is an open-source project and is free to use. You can deploy Argilla on your own infrastructure or use our cloud offering. + No. Argilla is an open-source project and is free to use. You can deploy Argilla on the HF Spaces or your own infrastructure. ??? Question "What data types does Argilla support?" - Text data, mostly. Argilla natively supports textual data, however, we do support rich text, which means you can represent different types of data in Argilla as long as you can convert it to text. For example, you can store images, audio, video, and any other type of data as long as you can convert it to their base64 representation or render them as HTML in for example an IFrame. + Text and images. However, you can use a [custom field](../how_to_guides/custom_fields.md), which means you can represent different types of data in Argilla. For example, you can store audio or video, and any other type of data as long as you can convert it to their base64 representation or render them as HTML in for example an IFrame. + +??? Question "Does Argilla generate synthetic data?" + + No. However, we provide a side library for that: [distilabel](https://github.com/argilla-io/distilabel), a framework for synthetic data and AI feedback for engineers who need fast, reliable and scalable pipelines based on verified research papers. ??? Question "Does Argilla train models?" diff --git a/argilla/docs/getting_started/quickstart.md b/argilla/docs/getting_started/quickstart.md index b4eb7946d1..4c6e829407 100644 --- a/argilla/docs/getting_started/quickstart.md +++ b/argilla/docs/getting_started/quickstart.md @@ -25,7 +25,7 @@ Argilla is a free, open-source, self-hosted tool. This means you need to deploy - Leave the default Space owner (your personal account) - Leave `USERNAME` and `PASSWORD` secrets empty since you'll sign in with your HF user as the Argilla Space `owner`. - Click create Space to launch Argilla 🚀. - - Once you see the Argilla UI, [go to the Sign in into the Argilla UI section](#sign-in-into-the-argilla-ui). If you see the `Building` message for longer than 2-3 min refresh the page. + - Once you see the Argilla UI, [go to the Sign in into the Argilla UI section](#sign-in-to-the-argilla-ui). If you see the `Building` message for longer than 2-3 min refresh the page. === "Python SDK" @@ -39,7 +39,7 @@ Argilla is a free, open-source, self-hosted tool. This means you need to deploy Next, we can use the `Argilla.deploy_on_spaces` method, which will create a Space in [the Hugging Face Hub](https://huggingface.co/). This method will automatically do the following: - - Deploy an Argilla Space on the Hugging Face Hub with [OAuth sign-in](#sign-in-into-the-argilla-ui) and a URL like `https://-argilla.hf.space`, which takes around 2-3 minutes. + - Deploy an Argilla Space on the Hugging Face Hub with [OAuth sign-in](#sign-in-to-the-argilla-ui) and a URL like `https://-argilla.hf.space`, which takes around 2-3 minutes. - Create a default workspace called `argilla` with an owner called `` and an Argilla token set to `api_key`. - Automatically return the authenticated Argilla client, which can directly be used to interact with your Argilla server. @@ -49,11 +49,8 @@ Argilla is a free, open-source, self-hosted tool. This means you need to deploy authenticated_client = rg.Argilla.deploy_on_spaces(api_key="") ``` - Learn how to [create your first dataset](create-your-first-dataset.md). - - !!! tip "Argilla API Key" - Your Argilla API key can be found in the `My Settings` page of your Argilla Space. Take a look at the [sign in to the UI section](#sign-in-into-the-argilla-ui) to learn how to retrieve it. + Your Argilla API key can be found in the `My Settings` page of your Argilla Space. Take a look at the [sign in to the UI section](#sign-in-to-the-argilla-ui) to learn how to retrieve it. !!! warning "Persistent storage `SMALL`" Not setting persistent storage to `SMALL` means that **you will loose your data when the Space restarts**. Spaces get restarted due to maintainance, inactivity, and every time you change your Spaces settings. If you want to **use the Space just for testing** you can use `FREE` temporarily. diff --git a/argilla/docs/how_to_guides/annotate.md b/argilla/docs/how_to_guides/annotate.md index c043b794fd..1d41f341fc 100644 --- a/argilla/docs/how_to_guides/annotate.md +++ b/argilla/docs/how_to_guides/annotate.md @@ -93,7 +93,7 @@ If you agree with the suggestions, you just need to click on the `Submit` button This is the default view to annotate your dataset linearly, displaying one record after another. !!! tip - You should use this view if you have a large number of required questions or need a strong focus on the record content to be labelled. This is also the recommended view for annotating a dataset sample to avoid potential biases introduced by using filters, search, sorting and bulk labelling. + You should use this view if you have a large number of required questions or need a strong focus on the record content to be labeled. This is also the recommended view for annotating a dataset sample to avoid potential biases introduced by using filters, search, sorting and bulk labeling. Once you submit your first response, the next record will appear automatically. To see again your submitted response, just click on `Prev`. @@ -130,7 +130,7 @@ You can also track your own progress in real time expanding the right-bottom pan ## Use search, filters, and sort -The UI offers various features designed for data exploration and understanding. Combining these features with bulk labelling can save you and your team hours of time. +The UI offers various features designed for data exploration and understanding. Combining these features with bulk labeling can save you and your team hours of time. !!! tip You should use this when you are familiar with your data and have large volumes to annotate based on verified beliefs and experience. diff --git a/argilla/docs/how_to_guides/custom_fields.md b/argilla/docs/how_to_guides/custom_fields.md index 7ea93046f3..eefdf0a66b 100644 --- a/argilla/docs/how_to_guides/custom_fields.md +++ b/argilla/docs/how_to_guides/custom_fields.md @@ -175,7 +175,7 @@ When `advanced_mode=True`, you can use the `template` argument to pass a full HT ### Usage example -Let's reproduce example from the [Without advanced mode](#without-advanced-mode) section but this time we will insert the [handlebars syntax engine](https://handlebarsjs.com/) into the template ourselves. +Let's reproduce example from the [Without advanced mode](#using-handlebars-in-your-template) section but this time we will insert the [handlebars syntax engine](https://handlebarsjs.com/) into the template ourselves. ```python template = """ diff --git a/argilla/docs/index.md b/argilla/docs/index.md index d0ce117466..0dc5edfa03 100644 --- a/argilla/docs/index.md +++ b/argilla/docs/index.md @@ -82,5 +82,5 @@ Argilla is a tool that can be used to achieve and keep **high-quality data stand AI teams from companies like [the Red Cross](https://510.global/), [Loris.ai](https://loris.ai/) and [Prolific](https://www.prolific.com/) use Argilla to **improve the quality and efficiency of AI** projects. They shared their experiences in the [AI community meetup](https://lu.ma/embed-checkout/evt-IQtRiSuXZCIW6FB). - AI for good: [the Red Cross presentation](https://youtu.be/ZsCqrAhzkFU?feature=shared) showcases **how their experts and AI team collaborate** by classifying and redirecting requests from refugees of the Ukrainian crisis to streamline the support processes of the Red Cross. -- Customer support: during [the Loris meetup](https://youtu.be/jWrtgf2w4VU?feature=shared) they showed how their AI team uses unsupervised and few-shot contrastive learning to help them **quickly validate and gain labelled samples for a huge amount of multi-label classifiers**. +- Customer support: during [the Loris meetup](https://youtu.be/jWrtgf2w4VU?feature=shared) they showed how their AI team uses unsupervised and few-shot contrastive learning to help them **quickly validate and gain labeled samples for a huge amount of multi-label classifiers**. - Research studies: [the showcase from Prolific](https://youtu.be/ePDlhIxnuAs?feature=shared) announced their integration with Argilla. They use it to actively **distribute data collection projects** among their annotating workforce. This allows them to quickly and **efficiently collect high-quality data** for their research studies. diff --git a/argilla/docs/reference/argilla/client.md b/argilla/docs/reference/argilla/client.md index e609963562..50506b3290 100644 --- a/argilla/docs/reference/argilla/client.md +++ b/argilla/docs/reference/argilla/client.md @@ -55,5 +55,8 @@ for dataset in my_workspace.datasets: --- ::: src.argilla.client.Argilla +::: src.argilla.client.Users +::: src.argilla.client.Workspaces +::: src.argilla.client.Datasets ::: src.argilla._helpers._deploy.SpacesDeploymentMixin From ae8d2bac4d0db2647fe9291a3c3e95ecfabb656d Mon Sep 17 00:00:00 2001 From: Natalia Elvira <126158523+nataliaElv@users.noreply.github.com> Date: Mon, 4 Nov 2024 13:16:38 +0100 Subject: [PATCH 02/16] Fix error (#5660) # Description Closes # **Type of change** - Bug fix (non-breaking change which fixes an issue) - New feature (non-breaking change which adds functionality) - Breaking change (fix or feature that would cause existing functionality to not work as expected) - Refactor (change restructuring the codebase without changing functionality) - Improvement (change adding some improvement to an existing functionality) - Documentation update **How Has This Been Tested** **Checklist** - I added relevant documentation - I followed the style guidelines of this project - I did a self-review of my code - I made corresponding changes to the documentation - I confirm My changes generate no new warnings - I have added tests that prove my fix is effective or that my feature works - I have added relevant notes to the CHANGELOG.md file (See https://keepachangelog.com/) --- argilla/docs/getting_started/quickstart.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/argilla/docs/getting_started/quickstart.md b/argilla/docs/getting_started/quickstart.md index 4c6e829407..2eeb8524c2 100644 --- a/argilla/docs/getting_started/quickstart.md +++ b/argilla/docs/getting_started/quickstart.md @@ -85,7 +85,7 @@ Congrats! Your Argilla server is ready to start your first project. The quickest way to start exploring the tool and create your first dataset is by importing an exiting one from the Hugging Face Hub. -To do this, log in to the Argilla UI and in the Home page click on "Import from Hub". You can choose one of the sample datasets or paste a repo id in the input. This will look something like `stanfordnlp/imdb`. +To do this, log in to the Argilla UI and in the Home page click on "Import dataset from Hugging Face". You can choose one of the sample datasets or paste a repo id in the input. This will look something like `stanfordnlp/imdb`. Argilla will automatically interpret the columns in the dataset to map them to Fields and Questions. From 6336c574f8a70d230deed70fc271cfb12dbc41bc Mon Sep 17 00:00:00 2001 From: Paco Aranda Date: Wed, 30 Oct 2024 21:56:59 +0100 Subject: [PATCH 03/16] [BUGFIX] argilla server: Prevent update `dataset.updated_at` when updating `dataset.last_activity_at` column (#5656) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # Description Closes # **Type of change** - Bug fix (non-breaking change which fixes an issue) **How Has This Been Tested** **Checklist** - I added relevant documentation - I followed the style guidelines of this project - I did a self-review of my code - I made corresponding changes to the documentation - I confirm My changes generate no new warnings - I have added tests that prove my fix is effective or that my feature works - I have added relevant notes to the CHANGELOG.md file (See https://keepachangelog.com/) --------- Co-authored-by: José Francisco Calvo --- argilla-server/CHANGELOG.md | 4 ++++ argilla-server/src/argilla_server/contexts/datasets.py | 7 ++++++- .../tests/unit/api/handlers/v1/test_responses.py | 2 ++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/argilla-server/CHANGELOG.md b/argilla-server/CHANGELOG.md index 9c385b82a2..d12224e627 100644 --- a/argilla-server/CHANGELOG.md +++ b/argilla-server/CHANGELOG.md @@ -16,6 +16,10 @@ These are the section headers that we use: ## [Unreleased]() +### Fixed + +- Fixed error so now `_touch_dataset_last_activity_at` function is not updating dataset's `updated_at` column. ([#5656](https://github.com/argilla-io/argilla/pull/5656)) + ## [2.4.0](https://github.com/argilla-io/argilla/compare/v2.3.1...v2.4.0) ### Added diff --git a/argilla-server/src/argilla_server/contexts/datasets.py b/argilla-server/src/argilla_server/contexts/datasets.py index 131904307b..b31aafe3b4 100644 --- a/argilla-server/src/argilla_server/contexts/datasets.py +++ b/argilla-server/src/argilla_server/contexts/datasets.py @@ -100,7 +100,12 @@ async def _touch_dataset_last_activity_at(db: AsyncSession, dataset: Dataset) -> None: await db.execute( - sqlalchemy.update(Dataset).where(Dataset.id == dataset.id).values(last_activity_at=datetime.utcnow()) + sqlalchemy.update(Dataset) + .where(Dataset.id == dataset.id) + .values( + last_activity_at=datetime.utcnow(), + updated_at=Dataset.__table__.c.updated_at, + ) ) diff --git a/argilla-server/tests/unit/api/handlers/v1/test_responses.py b/argilla-server/tests/unit/api/handlers/v1/test_responses.py index ceddf5201d..547e6faef4 100644 --- a/argilla-server/tests/unit/api/handlers/v1/test_responses.py +++ b/argilla-server/tests/unit/api/handlers/v1/test_responses.py @@ -102,6 +102,7 @@ async def test_update_response( "updated_at": datetime.fromisoformat(resp_body["updated_at"]).isoformat(), } + await db.refresh(dataset) assert dataset.last_activity_at > dataset_previous_last_activity_at assert dataset.updated_at == dataset_previous_updated_at @@ -421,6 +422,7 @@ async def test_delete_response( assert resp.status_code == 200 assert (await db.execute(select(func.count(Response.id)))).scalar() == 0 + await db.refresh(dataset) assert dataset.last_activity_at > dataset_previous_last_activity_at assert dataset.updated_at == dataset_previous_updated_at From 335791aaf5597d462a69b853b94677eb6d9e0999 Mon Sep 17 00:00:00 2001 From: Leire Aguirre Date: Mon, 4 Nov 2024 12:39:11 +0100 Subject: [PATCH 04/16] add middleware to redirect /datasets to home page --- argilla-frontend/pages/_id.vue | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/argilla-frontend/pages/_id.vue b/argilla-frontend/pages/_id.vue index e426416fb4..f73a79a95d 100644 --- a/argilla-frontend/pages/_id.vue +++ b/argilla-frontend/pages/_id.vue @@ -24,6 +24,11 @@ import { useNewDatasetViewModel } from "./useNewDatasetViewModel"; export default { + middleware({ route, redirect }) { + if (route.params.id === "datasets") { + redirect("/"); + } + }, mounted() { this.getNewDatasetByRepoIdFromUrl(); }, From 37807b5a846bcf9e5b286d87ca8744c7551d57cc Mon Sep 17 00:00:00 2001 From: Leire Date: Wed, 6 Nov 2024 12:46:36 +0100 Subject: [PATCH 05/16] fix: improve logic for detecting ChatFields (#5667) Check the role and content properties to validate the chat field --------- Co-authored-by: Francisco Aranda --- .../entities/hub/DatasetCreation.test.ts | 33 +++++++++++++++++++ .../v1/domain/entities/hub/Subset.ts | 13 ++++++-- 2 files changed, 44 insertions(+), 2 deletions(-) diff --git a/argilla-frontend/v1/domain/entities/hub/DatasetCreation.test.ts b/argilla-frontend/v1/domain/entities/hub/DatasetCreation.test.ts index ff21d2aedf..802a863dc7 100644 --- a/argilla-frontend/v1/domain/entities/hub/DatasetCreation.test.ts +++ b/argilla-frontend/v1/domain/entities/hub/DatasetCreation.test.ts @@ -29,6 +29,10 @@ const datasetInfo = { dtype: "string", _type: "Value", }, + extra: { + dtype: "int32", + _type: "Value", + }, }, ], metadata: { @@ -160,6 +164,35 @@ describe("DatasetCreation", () => { expect(chatField.required).toBeFalsy(); }); + it("skip other list feature from chat fields", () => { + const builder = new DatasetCreationBuilder("FAKE", { + default: { + ...datasetInfo.default, + features: { + some_list_feature: [ + { + other: { + dtype: "string", + _type: "Value", + }, + value: { + dtype: "string", + _type: "Value", + }, + }, + ], + }, + }, + }); + + const datasetCreation = builder.build(); + + expect( + datasetCreation.fields.filter((f) => f.type.value === "no mapping") + .length + ).toBe(1); + }); + it("get no mapped feature", () => { const builder = new DatasetCreationBuilder("FAKE", { default: { diff --git a/argilla-frontend/v1/domain/entities/hub/Subset.ts b/argilla-frontend/v1/domain/entities/hub/Subset.ts index f0cc82b0b7..de02ff89b5 100644 --- a/argilla-frontend/v1/domain/entities/hub/Subset.ts +++ b/argilla-frontend/v1/domain/entities/hub/Subset.ts @@ -7,6 +7,8 @@ import { QuestionCreation } from "./QuestionCreation"; type Structure = { name: string; options?: string[]; + role?: string; + content?: string; structure?: Structure[]; kindObject?: "Value" | "Image" | "ClassLabel" | "Sequence"; type?: "string" | MetadataTypes; @@ -33,6 +35,7 @@ export class Subset { for (const [name, value] of Object.entries(datasetInfo.features)) { if (Array.isArray(value)) { + const { role, content } = value[0]; this.structures.push({ name, structure: value.map((v) => { @@ -42,6 +45,8 @@ export class Subset { name: key, kindObject: value._type, type: value.dtype, + role, + content, }; }), }); @@ -134,8 +139,12 @@ export class Subset { return "text"; if (structure.kindObject === "Image") return "image"; - - if (structure.structure?.length > 0) return "chat"; + if ( + structure.structure?.length > 0 && + structure.structure[0].content && + structure.structure[0].role + ) + return "chat"; }; const field = FieldCreation.from( From 0fcce0aad967f0b456ba99ad614084714b44e557 Mon Sep 17 00:00:00 2001 From: Paco Aranda Date: Wed, 6 Nov 2024 16:49:26 +0100 Subject: [PATCH 06/16] [BUGFIX] `argilla frontend`: redirect after login (#5635) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Closes https://github.com/argilla-io/argilla/issues/5633 **Type of change** - Bug fix (non-breaking change which fixes an issue) - New feature (non-breaking change which adds functionality) **How Has This Been Tested** **Checklist** - I added relevant documentation - I followed the style guidelines of this project - I did a self-review of my code - I made corresponding changes to the documentation - I confirm My changes generate no new warnings - I have added tests that prove my fix is effective or that my feature works - I have added relevant notes to the CHANGELOG.md file (See https://keepachangelog.com/) --------- Co-authored-by: José Francisco Calvo Co-authored-by: José Francisco Calvo Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- argilla-frontend/CHANGELOG.md | 8 ++++++++ argilla-frontend/middleware/route-guard.ts | 15 +++++++-------- .../pages/oauth/_provider/useOAuthViewModel.ts | 14 ++++++++++++-- argilla-frontend/pages/sign-in.vue | 10 ---------- argilla-frontend/pages/useSignInViewModel.ts | 12 ++++++++++++ .../v1/infrastructure/services/useLocalStorage.ts | 9 ++++++++- .../tests/unit/api/handlers/v1/test_oauth2.py | 3 ++- 7 files changed, 49 insertions(+), 22 deletions(-) diff --git a/argilla-frontend/CHANGELOG.md b/argilla-frontend/CHANGELOG.md index 40cc59bc36..20ddc9d992 100644 --- a/argilla-frontend/CHANGELOG.md +++ b/argilla-frontend/CHANGELOG.md @@ -16,6 +16,14 @@ These are the section headers that we use: ## [Unreleased]() +### Added + +- Add a high-contrast theme & improvements for the forced-colors mode. ([#5661](https://github.com/argilla-io/argilla/pull/5661)) + +### Fixed + +- Fixed redirection problems after users sign-in using HF OAuth. ([#5635](https://github.com/argilla-io/argilla/pull/5635)) + ## [2.4.0](https://github.com/argilla-io/argilla/compare/v2.3.0...v2.4.0) ### Added diff --git a/argilla-frontend/middleware/route-guard.ts b/argilla-frontend/middleware/route-guard.ts index f333e69d1e..562e379af2 100644 --- a/argilla-frontend/middleware/route-guard.ts +++ b/argilla-frontend/middleware/route-guard.ts @@ -17,10 +17,16 @@ import { Context } from "@nuxt/types"; import { useRunningEnvironment } from "~/v1/infrastructure/services/useRunningEnvironment"; +import { useLocalStorage } from "~/v1/infrastructure/services"; + +const { set } = useLocalStorage(); export default ({ $auth, route, redirect }: Context) => { const { isRunningOnHuggingFace } = useRunningEnvironment(); + // By-pass unknown routes. This is needed to avoid errors with API calls. + if (route.name == null) return; + switch (route.name) { case "sign-in": if ($auth.loggedIn) return redirect("/"); @@ -28,12 +34,8 @@ export default ({ $auth, route, redirect }: Context) => { if (route.params.omitCTA) return; if (isRunningOnHuggingFace()) { - // eslint-disable-next-line @typescript-eslint/no-unused-vars - const { redirect: _, ...query } = route.query; - return redirect({ name: "welcome-hf-sign-in", - query, }); } break; @@ -50,14 +52,11 @@ export default ({ $auth, route, redirect }: Context) => { default: if (!$auth.loggedIn) { if (route.path !== "/") { - route.query.redirect = route.fullPath; + set("redirectTo", route.fullPath); } redirect({ name: "sign-in", - query: { - ...route.query, - }, }); } } diff --git a/argilla-frontend/pages/oauth/_provider/useOAuthViewModel.ts b/argilla-frontend/pages/oauth/_provider/useOAuthViewModel.ts index 91ccd6104d..1cbb722af7 100644 --- a/argilla-frontend/pages/oauth/_provider/useOAuthViewModel.ts +++ b/argilla-frontend/pages/oauth/_provider/useOAuthViewModel.ts @@ -2,7 +2,11 @@ import { useFetch, useRoute } from "@nuxtjs/composition-api"; import { useResolve } from "ts-injecty"; import { ProviderType } from "~/v1/domain/entities/oauth/OAuthProvider"; import { OAuthLoginUseCase } from "~/v1/domain/usecases/oauth-login-use-case"; -import { useRoutes, useTranslate } from "~/v1/infrastructure/services"; +import { + useRoutes, + useTranslate, + useLocalStorage, +} from "~/v1/infrastructure/services"; import { useNotifications } from "~/v1/infrastructure/services/useNotifications"; export const useOAuthViewModel = () => { @@ -11,11 +15,17 @@ export const useOAuthViewModel = () => { const routes = useRoute(); const router = useRoutes(); const oauthLoginUseCase = useResolve(OAuthLoginUseCase); + const { pop } = useLocalStorage(); useFetch(async () => { await tryLogin(); }); + const redirect = () => { + const redirect = pop("redirectTo"); + router.go(redirect || "/"); + }; + const tryLogin = async () => { const { params, query } = routes.value; @@ -23,12 +33,12 @@ export const useOAuthViewModel = () => { try { await oauthLoginUseCase.login(provider, query); + redirect(); } catch { notification.notify({ message: t("argilla.api.errors::UnauthorizedError"), type: "danger", }); - } finally { router.go("/"); } }; diff --git a/argilla-frontend/pages/sign-in.vue b/argilla-frontend/pages/sign-in.vue index 6d5d0f71ce..f804223a01 100644 --- a/argilla-frontend/pages/sign-in.vue +++ b/argilla-frontend/pages/sign-in.vue @@ -98,18 +98,8 @@ export default { }, }, methods: { - nextRedirect() { - const redirect_url = this.$nuxt.$route.query.redirect || "/"; - this.$router.push({ - path: redirect_url, - }); - }, async loginUser({ username, password }) { await this.login(username, password); - - this.$notification.clear(); - - this.nextRedirect(); }, async onLoginUser() { try { diff --git a/argilla-frontend/pages/useSignInViewModel.ts b/argilla-frontend/pages/useSignInViewModel.ts index 12075594be..b2d5f6f2ee 100644 --- a/argilla-frontend/pages/useSignInViewModel.ts +++ b/argilla-frontend/pages/useSignInViewModel.ts @@ -1,11 +1,23 @@ import { useResolve } from "ts-injecty"; import { AuthLoginUseCase } from "~/v1/domain/usecases/auth-login-use-case"; +import { useRoutes, useLocalStorage } from "~/v1/infrastructure/services"; +import { useNotifications } from "~/v1/infrastructure/services/useNotifications"; export const useSignInViewModel = () => { const useCase = useResolve(AuthLoginUseCase); + const router = useRoutes(); + const notification = useNotifications(); + const { pop } = useLocalStorage(); + + const redirect = () => { + const redirect = pop("redirectTo"); + router.go(redirect || "/"); + }; const login = async (username: string, password: string) => { await useCase.login(username, password); + notification.clear(); + redirect(); }; return { diff --git a/argilla-frontend/v1/infrastructure/services/useLocalStorage.ts b/argilla-frontend/v1/infrastructure/services/useLocalStorage.ts index f3331172bb..7d6c8a7483 100644 --- a/argilla-frontend/v1/infrastructure/services/useLocalStorage.ts +++ b/argilla-frontend/v1/infrastructure/services/useLocalStorage.ts @@ -1,4 +1,4 @@ -type Options = "showShortcutsHelper" | "layout"; +type Options = "showShortcutsHelper" | "layout" | "redirectTo"; const STORAGE_KEY = "argilla"; @@ -34,8 +34,15 @@ export const useLocalStorage = () => { } catch {} }; + const pop = (key: Options) => { + const value = get(key); + set(key, null); + return value; + }; + return { get, set, + pop, }; }; diff --git a/argilla-server/tests/unit/api/handlers/v1/test_oauth2.py b/argilla-server/tests/unit/api/handlers/v1/test_oauth2.py index 7f8d6ddee1..b5a3d87477 100644 --- a/argilla-server/tests/unit/api/handlers/v1/test_oauth2.py +++ b/argilla-server/tests/unit/api/handlers/v1/test_oauth2.py @@ -89,7 +89,7 @@ async def test_provider_huggingface_authentication( ): with mock.patch("argilla_server.security.settings.Settings.oauth", new_callable=lambda: default_oauth_settings): response = await async_client.get( - "/api/v1/oauth2/providers/huggingface/authentication", headers=owner_auth_header + "/api/v1/oauth2/providers/huggingface/authentication?extra=params", headers=owner_auth_header ) assert response.status_code == 303 @@ -97,6 +97,7 @@ async def test_provider_huggingface_authentication( assert redirect_url.scheme == b"https" assert redirect_url.host == b"huggingface.co" assert b"/oauth/authorize?response_type=code&client_id=client_id" in redirect_url.target + assert b"&extra=params" in redirect_url.target async def test_provider_authentication_with_oauth_disabled( self, From 7a042c5d7f0717802b0d9c7eb2c18c10fa873af8 Mon Sep 17 00:00:00 2001 From: Leire Aguirre Date: Mon, 4 Nov 2024 16:28:42 +0100 Subject: [PATCH 07/16] fix vars --- argilla-frontend/assets/scss/abstract/variables/_themes.scss | 4 ++-- .../configuration/DatasetConfigurationForm.vue | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/argilla-frontend/assets/scss/abstract/variables/_themes.scss b/argilla-frontend/assets/scss/abstract/variables/_themes.scss index 4ebd77bcb6..13b7228008 100644 --- a/argilla-frontend/assets/scss/abstract/variables/_themes.scss +++ b/argilla-frontend/assets/scss/abstract/variables/_themes.scss @@ -78,7 +78,7 @@ --bg-banner-error: hsl(3, 100%, 92%); --bg-tooltip: var(--color-dark-grey); --bg-config-card: hsl(227, 100%, 90%); - --bg-congig-alert: hsl(41, 100%, 82%, 0.8); + --bg-config-alert: hsl(41, 100%, 82%, 0.8); --fg-chat-1: #488d81; --fg-chat-2: #e07be0; --fg-chat-3: #fd926a; @@ -151,7 +151,7 @@ --bg-banner-error: hsl(3, 100%, 20%); --bg-tooltip: hsl(207, 9%, 32%); --bg-config-card: hsla(227, 100%, 66%, 20%); - --bg-congig-alert: hsl(41, 100%, 82%, 0.4); + --bg-config-alert: hsl(41, 100%, 82%, 0.4); --fg-chat-1: #628e87; --fg-chat-2: #af6daf; --fg-chat-3: #cd8065; diff --git a/argilla-frontend/components/features/dataset-creation/configuration/DatasetConfigurationForm.vue b/argilla-frontend/components/features/dataset-creation/configuration/DatasetConfigurationForm.vue index ca79107926..7727897f6c 100644 --- a/argilla-frontend/components/features/dataset-creation/configuration/DatasetConfigurationForm.vue +++ b/argilla-frontend/components/features/dataset-creation/configuration/DatasetConfigurationForm.vue @@ -229,7 +229,7 @@ export default { &__intro { display: block; padding: 4px; - background: var(--bg-congig-alert); + background: var(--bg-config-alert); @include font-size(12px); @include line-height(16px); } From 3614bba62fb1e01b2314c91051a16e0aea366d26 Mon Sep 17 00:00:00 2001 From: Paco Aranda Date: Thu, 7 Nov 2024 10:57:16 +0100 Subject: [PATCH 08/16] [BUGFIX] `argilla frontend`: Avoid call router.push when opening an external URL (#5675) # Description This PR fixes the `router.go` method and avoids calling `router.push` when the external flag is True **Type of change** - Bug fix (non-breaking change which fixes an issue) **How Has This Been Tested** **Checklist** - I added relevant documentation - I followed the style guidelines of this project - I did a self-review of my code - I made corresponding changes to the documentation - I confirm My changes generate no new warnings - I have added tests that prove my fix is effective or that my feature works - I have added relevant notes to the CHANGELOG.md file (See https://keepachangelog.com/) --- argilla-frontend/v1/infrastructure/services/useRoutes.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/argilla-frontend/v1/infrastructure/services/useRoutes.ts b/argilla-frontend/v1/infrastructure/services/useRoutes.ts index b4f1c2ba45..b604e62484 100644 --- a/argilla-frontend/v1/infrastructure/services/useRoutes.ts +++ b/argilla-frontend/v1/infrastructure/services/useRoutes.ts @@ -133,9 +133,9 @@ export const useRoutes = () => { } else { window.location.href = where; } + } else { + router.push(where); } - - router.push(where); }; const getQuery = () => { From 69df2bc5368fefae1fc0418febb5d032fac58dab Mon Sep 17 00:00:00 2001 From: Leire Date: Thu, 7 Nov 2024 15:19:21 +0100 Subject: [PATCH 09/16] [BUGFIX] visualisation of highlighted text (#5678) This PR fixes the visualisation of highlighted text in text and chat fields adding an id --- argilla-frontend/CHANGELOG.md | 1 + .../annotation/container/fields/chat-field/ChatField.vue | 1 + .../annotation/container/fields/text-field/TextField.vue | 2 +- .../annotation/container/fields/useSearchTextHighlight.ts | 6 ++++-- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/argilla-frontend/CHANGELOG.md b/argilla-frontend/CHANGELOG.md index 20ddc9d992..b7a18e38f7 100644 --- a/argilla-frontend/CHANGELOG.md +++ b/argilla-frontend/CHANGELOG.md @@ -23,6 +23,7 @@ These are the section headers that we use: ### Fixed - Fixed redirection problems after users sign-in using HF OAuth. ([#5635](https://github.com/argilla-io/argilla/pull/5635)) +- Fixed highlighting of the searched text in text and chat fields ([#5678](https://github.com/argilla-io/argilla/pull/5678)) ## [2.4.0](https://github.com/argilla-io/argilla/compare/v2.3.0...v2.4.0) diff --git a/argilla-frontend/components/features/annotation/container/fields/chat-field/ChatField.vue b/argilla-frontend/components/features/annotation/container/fields/chat-field/ChatField.vue index 971ede238a..1389c8f155 100644 --- a/argilla-frontend/components/features/annotation/container/fields/chat-field/ChatField.vue +++ b/argilla-frontend/components/features/annotation/container/fields/chat-field/ChatField.vue @@ -2,6 +2,7 @@
diff --git a/argilla-frontend/components/features/annotation/container/fields/text-field/TextField.vue b/argilla-frontend/components/features/annotation/container/fields/text-field/TextField.vue index 3fe4a7ced1..81437082bd 100644 --- a/argilla-frontend/components/features/annotation/container/fields/text-field/TextField.vue +++ b/argilla-frontend/components/features/annotation/container/fields/text-field/TextField.vue @@ -16,7 +16,7 @@
-
+
diff --git a/argilla-frontend/components/features/annotation/container/fields/useSearchTextHighlight.ts b/argilla-frontend/components/features/annotation/container/fields/useSearchTextHighlight.ts index 06ecce8dcb..2b23ab4d57 100644 --- a/argilla-frontend/components/features/annotation/container/fields/useSearchTextHighlight.ts +++ b/argilla-frontend/components/features/annotation/container/fields/useSearchTextHighlight.ts @@ -121,8 +121,10 @@ export const useSearchTextHighlight = (fieldId: string) => { const highlightText = (searchText: string) => { const fieldComponent = document.getElementById(FIELD_ID_TO_HIGHLIGHT); - if (!searchText || !fieldComponent) return; - + if (!searchText || !fieldComponent) { + CSS.highlights.delete(HIGHLIGHT_CLASS); + return; + } const ranges = createRangesToHighlight(fieldComponent, searchText); CSS.highlights.set(HIGHLIGHT_CLASS, new Highlight(...ranges)); From 6199bb8a44e7a9611ac28afc5de88c3073a9d3e1 Mon Sep 17 00:00:00 2001 From: Leire Date: Fri, 8 Nov 2024 12:11:57 +0100 Subject: [PATCH 10/16] Dataset Creation UI fixes & Improvements (#5670) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - [x] Rating values validate min / max - [x] Question name format and renaming - [x] Minor style adjustments - [x] Show required / not required in the form preview - [x] Redirect from /new/repoId to /repoId - [x] Redirect to error page when repoId is invalid --------- Co-authored-by: Francisco Aranda Co-authored-by: Paco Aranda Co-authored-by: José Francisco Calvo Co-authored-by: José Francisco Calvo Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- argilla-frontend/CHANGELOG.md | 3 + .../DatasetConfigurationForm.vue | 52 ++++++++---- .../DatasetConfigurationQuestion.vue | 2 +- .../questions/DatasetConfigurationRanking.vue | 1 + .../questions/DatasetConfigurationRating.vue | 85 +++++++++++++------ .../DatasetConfigurationChipsSelector.vue | 2 +- argilla-frontend/pages/new/_id.vue | 14 +++ .../pages/useNewDatasetViewModel.ts | 13 ++- .../directives/required-field.directive.js | 29 +++---- argilla-frontend/translation/en.js | 11 +++ argilla-frontend/translation/es.js | 3 + .../domain/entities/hub/QuestionCreation.ts | 9 ++ .../v1/domain/entities/hub/Subset.ts | 12 ++- .../repositories/HubRepository.ts | 10 ++- argilla-server/pyproject.toml | 1 + 15 files changed, 181 insertions(+), 66 deletions(-) create mode 100644 argilla-frontend/pages/new/_id.vue diff --git a/argilla-frontend/CHANGELOG.md b/argilla-frontend/CHANGELOG.md index b7a18e38f7..9fa3b92984 100644 --- a/argilla-frontend/CHANGELOG.md +++ b/argilla-frontend/CHANGELOG.md @@ -19,11 +19,14 @@ These are the section headers that we use: ### Added - Add a high-contrast theme & improvements for the forced-colors mode. ([#5661](https://github.com/argilla-io/argilla/pull/5661)) +- Added redirect to error page when repoId is invalid ([#5670](https://github.com/argilla-io/argilla/pull/5670)) ### Fixed - Fixed redirection problems after users sign-in using HF OAuth. ([#5635](https://github.com/argilla-io/argilla/pull/5635)) - Fixed highlighting of the searched text in text and chat fields ([#5678](https://github.com/argilla-io/argilla/pull/5678)) +- Fixed validation for rating question when creating a dataset ([#5670](https://github.com/argilla-io/argilla/pull/5670)) +- Fixed question name based on question type when creating a dataset ([#5670](https://github.com/argilla-io/argilla/pull/5670)) ## [2.4.0](https://github.com/argilla-io/argilla/compare/v2.3.0...v2.4.0) diff --git a/argilla-frontend/components/features/dataset-creation/configuration/DatasetConfigurationForm.vue b/argilla-frontend/components/features/dataset-creation/configuration/DatasetConfigurationForm.vue index 7727897f6c..82d857a91b 100644 --- a/argilla-frontend/components/features/dataset-creation/configuration/DatasetConfigurationForm.vue +++ b/argilla-frontend/components/features/dataset-creation/configuration/DatasetConfigurationForm.vue @@ -31,13 +31,11 @@ :group="{ name: 'fields' }" ghost-class="config-form__ghost" :disabled="isFocused" - @start="drag = true" - @end="drag = false" > { + const numberInName = question.name.split("_").pop(); + return parseInt(numberInName) || 0; + }) + ); + }, + }, methods: { createDataset() { this.create(this.dataset); }, - addQuestion(type) { - const questionName = `${type} ${this.dataset.selectedSubset.questions.length}`; - this.dataset.selectedSubset.addQuestion(questionName, { type }); + generateName(type, number) { + const typeName = this.$t(`config.questionId.${type}`); + return `${typeName}_${parseInt(number) || 0}`; }, - onTypeIsChanged(name, type) { - this.dataset.selectedSubset.addQuestion(name, { - type: type.value, + addQuestion(type) { + const questionName = this.generateName( + type, + this.getMaxNumberInNames + 1 + ); + this.dataset.selectedSubset.addQuestion(questionName, { + type, }); }, + onTypeIsChanged(oldName, type) { + const numberInName = oldName.split("_").pop(); + const index = this.dataset.selectedSubset.questions.findIndex( + (q) => q.name === oldName + ); + this.dataset.selectedSubset.removeQuestion(oldName); + const newQuestionName = this.generateName(type.value, numberInName); + this.dataset.selectedSubset.addQuestion( + newQuestionName, + { + type: type.value, + }, + index !== -1 ? index : undefined + ); + }, }, setup() { return useDatasetConfigurationForm(); @@ -223,7 +249,6 @@ export default { } &__ghost { opacity: 0.5; - background: lime; } &__selector { &__intro { @@ -247,8 +272,5 @@ export default { justify-content: center; } } - .flip-list-move { - transition: transform 0.3s; - } } diff --git a/argilla-frontend/components/features/dataset-creation/configuration/questions/DatasetConfigurationQuestion.vue b/argilla-frontend/components/features/dataset-creation/configuration/questions/DatasetConfigurationQuestion.vue index 387f1be38a..6dcfd4dd20 100644 --- a/argilla-frontend/components/features/dataset-creation/configuration/questions/DatasetConfigurationQuestion.vue +++ b/argilla-frontend/components/features/dataset-creation/configuration/questions/DatasetConfigurationQuestion.vue @@ -29,7 +29,7 @@ /> -
- +
+
+ +
+
diff --git a/argilla-frontend/pages/useNewDatasetViewModel.ts b/argilla-frontend/pages/useNewDatasetViewModel.ts index a66fb469f3..8cce1d4f3a 100644 --- a/argilla-frontend/pages/useNewDatasetViewModel.ts +++ b/argilla-frontend/pages/useNewDatasetViewModel.ts @@ -1,15 +1,20 @@ import { useResolve } from "ts-injecty"; -import { ref, useRoute } from "@nuxtjs/composition-api"; +import { ref, useRoute, useContext } from "@nuxtjs/composition-api"; import { GetDatasetCreationUseCase } from "~/v1/domain/usecases/get-dataset-creation-use-case"; export const useNewDatasetViewModel = () => { + const { error } = useContext(); const datasetConfig = ref(); const getDatasetCreationUseCase = useResolve(GetDatasetCreationUseCase); const getNewDatasetByRepoId = async (repositoryId: string) => { - datasetConfig.value = await getDatasetCreationUseCase.execute( - decodeURI(repositoryId) - ); + try { + datasetConfig.value = await getDatasetCreationUseCase.execute( + repositoryId + ); + } catch (e) { + error({ statusCode: 404, message: "Cannot fetch the dataset" }); + } }; const getNewDatasetByRepoIdFromUrl = async () => { diff --git a/argilla-frontend/plugins/directives/required-field.directive.js b/argilla-frontend/plugins/directives/required-field.directive.js index 163fff4c04..c478d96c18 100644 --- a/argilla-frontend/plugins/directives/required-field.directive.js +++ b/argilla-frontend/plugins/directives/required-field.directive.js @@ -5,22 +5,19 @@ import Vue from "vue"; // => color (String) the color of the asterisk : black by default Vue.directive("required-field", { - bind: (element, binding, node) => { - if (binding?.value) { - const { color, show } = binding?.value ?? { show: true, color: "black" }; - - if (!show) return; - - const text = document.createTextNode(" *"); - const textWrapper = document.createElement("span"); - textWrapper.setAttribute("title", "Required response"); - textWrapper.setAttribute("role", "mark"); - textWrapper.style.color = color; - textWrapper.appendChild(text); - - node.context.$nextTick(() => { - element.insertAdjacentElement("afterEnd", textWrapper); - }); + bind(element, binding) { + const span = document.createElement("span"); + span.textContent = " *"; + span.style.color = binding.value.color; + span.setAttribute("title", "Required response"); + span.setAttribute("role", "mark"); + element.appendChild(span); + span.style.display = binding.value.show ? "inline" : "none"; + }, + update(element, binding) { + const span = element.querySelector("span"); + if (span) { + span.style.display = binding.value.show ? "inline" : "none"; } }, }); diff --git a/argilla-frontend/translation/en.js b/argilla-frontend/translation/en.js index caf52c564a..009525c13c 100644 --- a/argilla-frontend/translation/en.js +++ b/argilla-frontend/translation/en.js @@ -282,6 +282,9 @@ export default { atLeastTwoOptions: "At least two options are required", optionsWithoutLabel: "Empty options are not allowed", }, + rating: { + atLeastTwoOptions: "At least two options are required", + }, }, atLeastOneQuestion: "At least one question is required.", atLeastOneRequired: "At least one required question is needed.", @@ -327,6 +330,14 @@ export default { span: "Span", "no mapping": "No mapping", }, + questionId: { + text: "text", + rating: "rating", + label_selection: "label", + ranking: "ranking", + multi_label_selection: "multi-label", + span: "span", + }, }, persistentStorage: { adminOrOwner: diff --git a/argilla-frontend/translation/es.js b/argilla-frontend/translation/es.js index fc00604f26..ed40c9396e 100644 --- a/argilla-frontend/translation/es.js +++ b/argilla-frontend/translation/es.js @@ -280,6 +280,9 @@ export default { atLeastTwoOptions: "Se requieren al menos dos opciones", optionsWithoutLabel: "No se permiten opciones vacĂ­as", }, + rating: { + atLeastTwoOptions: "Se requieren al menos dos opciones", + }, }, atLeastOneQuestion: "Se requiere al menos una pregunta.", atLeastOneRequired: "Se requiere al menos una pregunta obligatoria.", diff --git a/argilla-frontend/v1/domain/entities/hub/QuestionCreation.ts b/argilla-frontend/v1/domain/entities/hub/QuestionCreation.ts index 2d23e49ed4..c8ff905aa0 100644 --- a/argilla-frontend/v1/domain/entities/hub/QuestionCreation.ts +++ b/argilla-frontend/v1/domain/entities/hub/QuestionCreation.ts @@ -64,6 +64,10 @@ export class QuestionCreation { this.required = true; } + get isRequired(): boolean { + return this.required; + } + get isTextType(): boolean { return this.type.isTextType; } @@ -111,6 +115,11 @@ export class QuestionCreation { ); } } + if (this.isRatingType) { + if (this.options.length < 2) { + errors.push("datasetCreation.questions.rating.atLeastTwoOptions"); + } + } return errors; } diff --git a/argilla-frontend/v1/domain/entities/hub/Subset.ts b/argilla-frontend/v1/domain/entities/hub/Subset.ts index de02ff89b5..ba72804400 100644 --- a/argilla-frontend/v1/domain/entities/hub/Subset.ts +++ b/argilla-frontend/v1/domain/entities/hub/Subset.ts @@ -202,7 +202,11 @@ export class Subset { } } - public addQuestion(name: string, settings: QuestionPrototype) { + public addQuestion( + name: string, + settings: QuestionPrototype, + position?: number + ) { const { type } = settings; if (type === "label_selection") { settings.options = [ @@ -266,6 +270,10 @@ export class Subset { return; } - this.questions.push(new QuestionCreation(name, settings)); + this.questions.splice( + position ?? this.questions.length, + 0, + new QuestionCreation(name, settings) + ); } } diff --git a/argilla-frontend/v1/infrastructure/repositories/HubRepository.ts b/argilla-frontend/v1/infrastructure/repositories/HubRepository.ts index 82ef090e67..7ca3528929 100644 --- a/argilla-frontend/v1/infrastructure/repositories/HubRepository.ts +++ b/argilla-frontend/v1/infrastructure/repositories/HubRepository.ts @@ -2,6 +2,10 @@ import { type NuxtAxiosInstance } from "@nuxtjs/axios"; import { PublicNuxtAxiosInstance } from "../services"; import { DatasetCreation } from "~/v1/domain/entities/hub/DatasetCreation"; +export const enum HUB_REPOSITORY_ERRORS { + NOT_EXIST = "ERROR_FETCHING_DATASET", +} + export class HubRepository { private axios: NuxtAxiosInstance; constructor(axios: PublicNuxtAxiosInstance) { @@ -19,8 +23,10 @@ export class HubRepository { ); return data.dataset_info; - } catch { - return {}; + } catch (e) { + throw { + response: HUB_REPOSITORY_ERRORS.NOT_EXIST, + }; } } diff --git a/argilla-server/pyproject.toml b/argilla-server/pyproject.toml index d97da2eec0..37bf1f36df 100644 --- a/argilla-server/pyproject.toml +++ b/argilla-server/pyproject.toml @@ -1,4 +1,5 @@ [project] +# Remove me name = "argilla-server" dynamic = ["version"] description = "Open-source tool for exploring, labeling, and monitoring data for NLP projects." From fc8fdf9e9a4a23063d667a09e89bdb7783a21c67 Mon Sep 17 00:00:00 2001 From: Francisco Aranda Date: Fri, 8 Nov 2024 12:26:06 +0100 Subject: [PATCH 11/16] chore: Set release version --- argilla-frontend/package.json | 2 +- argilla-server/src/argilla_server/_version.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/argilla-frontend/package.json b/argilla-frontend/package.json index 8af809ce30..42958dab74 100644 --- a/argilla-frontend/package.json +++ b/argilla-frontend/package.json @@ -1,6 +1,6 @@ { "name": "argilla", - "version": "2.4.0", + "version": "2.4.1", "private": true, "scripts": { "dev": "nuxt", diff --git a/argilla-server/src/argilla_server/_version.py b/argilla-server/src/argilla_server/_version.py index cbb95518ab..0cb36e7d0f 100644 --- a/argilla-server/src/argilla_server/_version.py +++ b/argilla-server/src/argilla_server/_version.py @@ -15,4 +15,4 @@ # coding: utf-8 # -__version__ = "2.4.0" +__version__ = "2.4.1" From 4ca538ec68742705047bb46b5d5729b0f4ec4801 Mon Sep 17 00:00:00 2001 From: Francisco Aranda Date: Fri, 8 Nov 2024 12:35:54 +0100 Subject: [PATCH 12/16] chore: Set version in CHANGELOGs --- argilla-frontend/CHANGELOG.md | 2 ++ argilla-server/CHANGELOG.md | 2 ++ 2 files changed, 4 insertions(+) diff --git a/argilla-frontend/CHANGELOG.md b/argilla-frontend/CHANGELOG.md index 9fa3b92984..914a796b5f 100644 --- a/argilla-frontend/CHANGELOG.md +++ b/argilla-frontend/CHANGELOG.md @@ -16,6 +16,8 @@ These are the section headers that we use: ## [Unreleased]() +## [2.4.1](https://github.com/argilla-io/argilla/compare/v2.4.0...v2.4.1) + ### Added - Add a high-contrast theme & improvements for the forced-colors mode. ([#5661](https://github.com/argilla-io/argilla/pull/5661)) diff --git a/argilla-server/CHANGELOG.md b/argilla-server/CHANGELOG.md index d12224e627..695155f8e8 100644 --- a/argilla-server/CHANGELOG.md +++ b/argilla-server/CHANGELOG.md @@ -16,6 +16,8 @@ These are the section headers that we use: ## [Unreleased]() +## [2.4.1](https://github.com/argilla-io/argilla/compare/v2.4.0...v2.4.1) + ### Fixed - Fixed error so now `_touch_dataset_last_activity_at` function is not updating dataset's `updated_at` column. ([#5656](https://github.com/argilla-io/argilla/pull/5656)) From db65c4bc8e39c7c6aedb08b1730bc0ed64c9418f Mon Sep 17 00:00:00 2001 From: Paco Aranda Date: Fri, 8 Nov 2024 12:39:03 +0100 Subject: [PATCH 13/16] chore: Remove extra line --- argilla-server/pyproject.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/argilla-server/pyproject.toml b/argilla-server/pyproject.toml index 37bf1f36df..d97da2eec0 100644 --- a/argilla-server/pyproject.toml +++ b/argilla-server/pyproject.toml @@ -1,5 +1,4 @@ [project] -# Remove me name = "argilla-server" dynamic = ["version"] description = "Open-source tool for exploring, labeling, and monitoring data for NLP projects." From ad521ae004c0a23b4026c972d56c4900fd9b131b Mon Sep 17 00:00:00 2001 From: Francisco Aranda Date: Fri, 8 Nov 2024 12:46:12 +0100 Subject: [PATCH 14/16] chore: Remove changelog line --- argilla-frontend/CHANGELOG.md | 1 - 1 file changed, 1 deletion(-) diff --git a/argilla-frontend/CHANGELOG.md b/argilla-frontend/CHANGELOG.md index 914a796b5f..00dc681bc8 100644 --- a/argilla-frontend/CHANGELOG.md +++ b/argilla-frontend/CHANGELOG.md @@ -20,7 +20,6 @@ These are the section headers that we use: ### Added -- Add a high-contrast theme & improvements for the forced-colors mode. ([#5661](https://github.com/argilla-io/argilla/pull/5661)) - Added redirect to error page when repoId is invalid ([#5670](https://github.com/argilla-io/argilla/pull/5670)) ### Fixed From 9309cf38e138dadf1605c2c99b279a8f2391b19d Mon Sep 17 00:00:00 2001 From: Leire Aguirre Date: Mon, 11 Nov 2024 09:28:39 +0100 Subject: [PATCH 15/16] fix highlighting in span fields --- .../fields/span-annotation/SpanAnnotationTextField.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/argilla-frontend/components/features/annotation/container/fields/span-annotation/SpanAnnotationTextField.vue b/argilla-frontend/components/features/annotation/container/fields/span-annotation/SpanAnnotationTextField.vue index a58c25ce32..61c5d5c864 100644 --- a/argilla-frontend/components/features/annotation/container/fields/span-annotation/SpanAnnotationTextField.vue +++ b/argilla-frontend/components/features/annotation/container/fields/span-annotation/SpanAnnotationTextField.vue @@ -35,7 +35,7 @@
From b483560596b7d21c20b5a9673e0337dc6447b95d Mon Sep 17 00:00:00 2001 From: Leire Aguirre Date: Mon, 11 Nov 2024 09:30:22 +0100 Subject: [PATCH 16/16] update CHANGELOG --- argilla-frontend/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/argilla-frontend/CHANGELOG.md b/argilla-frontend/CHANGELOG.md index 00dc681bc8..d2b9c76283 100644 --- a/argilla-frontend/CHANGELOG.md +++ b/argilla-frontend/CHANGELOG.md @@ -25,7 +25,7 @@ These are the section headers that we use: ### Fixed - Fixed redirection problems after users sign-in using HF OAuth. ([#5635](https://github.com/argilla-io/argilla/pull/5635)) -- Fixed highlighting of the searched text in text and chat fields ([#5678](https://github.com/argilla-io/argilla/pull/5678)) +- Fixed highlighting of the searched text in text, span and chat fields ([#5678](https://github.com/argilla-io/argilla/pull/5678)) - Fixed validation for rating question when creating a dataset ([#5670](https://github.com/argilla-io/argilla/pull/5670)) - Fixed question name based on question type when creating a dataset ([#5670](https://github.com/argilla-io/argilla/pull/5670))