Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DOCS] Deploy on spaces review #5704

Merged
merged 2 commits into from
Nov 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion argilla/docs/getting_started/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ Argilla is a free, open-source, self-hosted tool. This means you need to deploy
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.
Not setting persistent storage to `SMALL` means that **you will loose your data when the Space restarts**. Spaces get restarted due to maintenance, inactivity, and every time you change your Spaces settings. If you want to **use the Space just for testing** you can use `FREE` temporarily.

If you want to deploy Argilla within a Hugging Face organization, setup a more stable Space, or understand the settings, [check out the HF Spaces settings guide](how-to-configure-argilla-on-huggingface.md).

Expand Down
41 changes: 20 additions & 21 deletions argilla/src/argilla/_helpers/_deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,26 +44,25 @@ def deploy_on_spaces(
private: Optional[Union[bool, None]] = False,
) -> "Argilla":
"""
Deploys Argilla on Hugging Face Spaces.

Args:
api_key (str): The Argilla API key to be defined for the owner user and creator of the Space.
repo_name (Optional[str]): The ID of the repository where Argilla will be deployed. Defaults to "argilla".
org_name (Optional[str]): The name of the organization where Argilla will be deployed. Defaults to None.
hf_token (Optional[Union[str, None]]): The Hugging Face authentication token. Defaults to None.
space_storage (Optional[Union[str, SpaceStorage]]): The persistant storage size for the space. Defaults to None without persistant storage.
space_hardware (Optional[Union[str, SpaceHardware]]): The hardware configuration for the space. Defaults to "cpu-basic" with downtime after 48 hours of inactivity.
private (Optional[Union[bool, None]]): Whether the space should be private. Defaults to False.

Returns:
Argilla: The Argilla client.

Example:
```Python
import argilla as rg
api
client = rg.Argilla.deploy_on_spaces(api_key="12345678")
```
Deploys Argilla on Hugging Face Spaces.

Args:
api_key (str): The Argilla API key to be defined for the owner user and creator of the Space.
repo_name (Optional[str]): The ID of the repository where Argilla will be deployed. Defaults to "argilla".
org_name (Optional[str]): The name of the organization where Argilla will be deployed. Defaults to None.
hf_token (Optional[Union[str, None]]): The Hugging Face authentication token. Defaults to None.
space_storage (Optional[Union[str, SpaceStorage]]): The persistent storage size for the space. Defaults to None without persistent storage.
space_hardware (Optional[Union[str, SpaceHardware]]): The hardware configuration for the space. Defaults to "cpu-basic" with downtime after 48 hours of inactivity.
private (Optional[Union[bool, None]]): Whether the space should be private. Defaults to False.

Returns:
Argilla: The Argilla client.

Example:
```Python
import argilla as rg
client = rg.Argilla.deploy_on_spaces(api_key="12345678")
```
"""
hf_token = cls._acquire_hf_token(ht_token=hf_token)
hf_api = HfApi(token=hf_token)
Expand Down Expand Up @@ -126,7 +125,7 @@ def deploy_on_spaces(
@staticmethod
def _space_storage_warning() -> None:
warnings.warn(
"No storage provided. The space will not have persistant storage so every 48 hours your data will be reset."
"No storage provided. The space will not have persistent storage so every 48 hours your data will be reset."
)

@classmethod
Expand Down
Loading