Skip to content

Commit

Permalink
Merge branch 'main' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
jfcalvo committed May 9, 2024
2 parents 7dae34b + 3129f54 commit 14b9d3a
Show file tree
Hide file tree
Showing 10 changed files with 30 additions and 23 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ These are the section headers that we use:

## [Unreleased]()

## [1.28.0](https://github.com/argilla-io/argilla/compare/v1.27.0...v1.28.0)

### Added

- Added suggestion multi score attribute. ([#4730](https://github.com/argilla-io/argilla/pull/4730))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ You can set the following environment variables to further configure your server

### Hugging Face

- `ARGILLA_SHOW_HUGGINGFACE_SPACE_PERSISTANT_STORAGE_WARNING`: When Argilla is running on Hugging Face Spaces you can use this environment variable to disable the warning message showed when persistant storage is disabled for the space (Default: `true`).
- `ARGILLA_SHOW_HUGGINGFACE_SPACE_PERSISTENT_STORAGE_WARNING`: When Argilla is running on Hugging Face Spaces you can use this environment variable to disable the warning message showed when persistent storage is disabled for the space (Default: `true`).

### Client

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,14 +142,18 @@ If you have improvement suggestions or need specific support, please join [Argil

## Setting up persistent storage

Hugging Face Spaces recently introduced a feature for persistent storage, which must be enabled manually through the Hugging Face Spaces settings. Without this activation, and if you're not subscribed to a paid space upgrade, the space will automatically shut down after 48 hours of inactivity and do a factory reset when it is restarted, meaning that all the data of the space will be lost, including all created users, workspaces and datasets. To prevent this, we highly recommend using the persistent storage layer offered by Hugging Face.
Hugging Face Spaces recently introduced a feature for persistent storage, which must be enabled manually through the Hugging Face Spaces settings. Without this activation, and if you're not subscribed to a paid space upgrade, the space will automatically shut down after 48 hours of inactivity and do a factory reset when it is restarted, meaning that all the data in the space will be lost, including all created users, workspaces and datasets. To prevent this, we highly recommend using the persistent storage layer offered by Hugging Face.

To enable [persistent storage](https://huggingface.co/docs/hub/spaces-storage#persistent-storage), go to the "Settings" tab on your created Space and click on the desired plan on the "Persistent Storage" section. This will enable persistent storage for your Space and you will be able to use it for data labeling and feedback collection.

![Alt text](../../../_static/images/installation/huggingface-spaces/persistent-storage.PNG)

```{warning}
The moment you enable persistent storage, the space will restart and all data in the space will be lost. Make sure that you enable the storage before creating any assets or save the datasets you wish to keep and re-create your assets once the space has restarted.
```

```{note}
If you haven't enabled persistent storage, Argilla will show a warning message by default. If you don't require persistent storage for your space and want to prevent the warning message from appearing, you can set the environment variable `ARGILLA_SHOW_HUGGINGFACE_SPACE_PERSISTANT_STORAGE_WARNING` to `false`. This will suppress the warning message, even if persistent storage is not enabled for the space.
If you haven't enabled persistent storage, Argilla will show a warning message by default. If you don't require persistent storage for your space and want to prevent the warning message from appearing, you can set the environment variable `ARGILLA_SHOW_HUGGINGFACE_SPACE_PERSISTENT_STORAGE_WARNING` to `false`. This will suppress the warning message, even if persistent storage is not enabled for the space.
```

## Setting up secret environment variables
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ record = rg.FeedbackRecord(
{
"question_name": "relevant",
"value": "YES",
"score": 0.7,
"agent": model_name,
}
]
Expand All @@ -41,6 +42,7 @@ record = rg.FeedbackRecord(
{
"question_name": "content_class",
"value": ["hate", "violent"],
"score": [0.3, 0.2],
"agent": model_name,
}
]
Expand All @@ -62,6 +64,7 @@ record = rg.FeedbackRecord(
{"rank": 2, "value": "reply-1"},
{"rank": 3, "value": "reply-3"},
],
"score": [0.20, 0.10, 0.01],
"agent": model_name,
}
]
Expand All @@ -79,6 +82,7 @@ record = rg.FeedbackRecord(
{
"question_name": "quality",
"value": 5,
"score": 0.7,
"agent": model_name,
}
]
Expand Down Expand Up @@ -122,6 +126,7 @@ record = rg.FeedbackRecord(
{
"question_name": "corrected-text",
"value": "This is a *suggestion*.",
"score": 0.7,
"agent": model_name,
}
]
Expand Down
10 changes: 5 additions & 5 deletions frontend/v1/domain/entities/environment/Environment.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export class Environment {
constructor(
private readonly argilla: {
showHuggingfaceSpacePersistantStorageWarning: boolean;
showHuggingfaceSpacePersistentStorageWarning: boolean;
},
private readonly huggingface: {
spaceId: string;
Expand All @@ -10,14 +10,14 @@ export class Environment {
spaceHost: string;
spaceRepoName: string;
spaceAuthorName: string;
spacePersistantStorageEnabled: boolean;
spacePersistentStorageEnabled: boolean;
}
) {}

get shouldShowHuggingfaceSpacePersistantStorageWarning(): boolean {
get shouldShowHuggingfaceSpacePersistentStorageWarning(): boolean {
return (
this.argilla.showHuggingfaceSpacePersistantStorageWarning &&
!this.huggingface.spacePersistantStorageEnabled
this.argilla.showHuggingfaceSpacePersistentStorageWarning &&
!this.huggingface.spacePersistentStorageEnabled
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ export class EnvironmentRepository implements IEnvironmentRepository {

return new Environment(
{
showHuggingfaceSpacePersistantStorageWarning:
argilla.show_huggingface_space_persistant_storage_warning,
showHuggingfaceSpacePersistentStorageWarning:
argilla.show_huggingface_space_persistent_storage_warning,
},
{
spaceId: huggingface.space_id,
Expand All @@ -35,8 +35,8 @@ export class EnvironmentRepository implements IEnvironmentRepository {
spaceHost: huggingface.space_host,
spaceRepoName: huggingface.space_repo_name,
spaceAuthorName: huggingface.space_author_name,
spacePersistantStorageEnabled:
huggingface.space_persistant_storage_enabled,
spacePersistentStorageEnabled:
huggingface.space_persistent_storage_enabled,
}
);
} catch (err) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,14 @@ describe("useRunningEnvironment", () => {
Promise.resolve(
new Environment(
{
showHuggingfaceSpacePersistantStorageWarning: false,
showHuggingfaceSpacePersistentStorageWarning: false,
},
{
spaceAuthorName: "USER_NAME_FAKE",
spaceRepoName: "AWESOME_SPACE",
spaceHost: "huggingface.co",
spaceId: "USER_NAME_FAKE/AWESOME_SPACE",
spacePersistantStorageEnabled: true,
spacePersistentStorageEnabled: true,
spaceSubdomain: "spaces",
spaceTitle: "AWESOME_SPACE",
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export const useRunningEnvironment = () => {

const environment = await getEnvironment();

return environment.shouldShowHuggingfaceSpacePersistantStorageWarning;
return environment.shouldShowHuggingfaceSpacePersistentStorageWarning;
};

const getHuggingFaceSpace = async () => {
Expand Down
4 changes: 2 additions & 2 deletions frontend/v1/infrastructure/types/environment.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export interface BackendEnvironment {
argilla: {
show_huggingface_space_persistant_storage_warning: boolean;
show_huggingface_space_persistent_storage_warning: boolean;
};
huggingface: {
space_id: string;
Expand All @@ -9,6 +9,6 @@ export interface BackendEnvironment {
space_host: string;
space_repo_name: string;
space_author_name: string;
space_persistant_storage_enabled: boolean;
space_persistent_storage_enabled: boolean;
};
}
8 changes: 2 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,8 @@ dependencies = [
dynamic = ["version"]

[project.optional-dependencies]
server = [
"argilla-server@git+https://github.com/argilla-io/argilla-server.git#egg=main",
]
server-postgresql = [
"argilla-server@git+https://github.com/argilla-io/argilla-server.git#egg=main[postgresql]",
]
server = ["argilla-server"]
server-postgresql = ["argilla-server[postgresql]"]
listeners = ["schedule ~= 1.1.0"]
integrations = [
"PyYAML >= 5.4.1,< 6.1.0", # Required by `argilla.client.feedback.config` just used in `HuggingFaceDatasetMixin`
Expand Down

0 comments on commit 14b9d3a

Please sign in to comment.