Skip to content

Commit

Permalink
[DOCS] Deploy on spaces review (#5704)
Browse files Browse the repository at this point in the history
# Description
<!-- Please include a summary of the changes and the related issue.
Please also include relevant motivation and context. List any
dependencies that are required for this change. -->

Fix some typos and the API reference visualization.

Closes #<issue_number>

**Type of change**
<!-- Please delete options that are not relevant. Remember to title the
PR according to the 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**
<!-- Please add some reference about how your feature has been tested.
-->

**Checklist**
<!-- Please go over the list and make sure you've taken everything into
account -->

- 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/)
  • Loading branch information
sdiazlor authored Nov 21, 2024
1 parent 1c8f528 commit 5f6c291
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 22 deletions.
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

0 comments on commit 5f6c291

Please sign in to comment.