Skip to content

Commit

Permalink
Add draft quickstart and new getting started sections
Browse files Browse the repository at this point in the history
  • Loading branch information
dvsrepo committed Jul 25, 2024
1 parent 8d66ad1 commit 65419a4
Show file tree
Hide file tree
Showing 7 changed files with 191 additions and 31 deletions.
12 changes: 12 additions & 0 deletions argilla/docs/assets/docker-mark-blue.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
---
description: Configure Argilla on Hugging Face Spaces
---
By default Argilla Spaces are **configured with a Sign in with Hugging Face button**. This enables other users in the Hugging Face Hub to join your Space and collaborate on your projects.

If you **don't want anyone else to join your space or want full control to add users**:

1. You can disable the HF OAuth, or
2. Make your Space Private.

If you want to restrict access to your Space to members of an specific Hugging Face organization:

!!! info "Creating a Space under your personal account"
If you are creating the Space under your personal account, **don't insert any value for `USERNAME` and `PASSWORD`**. Once you launch the Space you will be able to Sign in with your Hugging Face username and the `owner` role.

!!! info "Creating a Space under an organization"
If you are creating the Space under an organization **make sure to insert your Hugging Face username in the secret `USERNAME`**. In this way, you'll be able to Sign in with your Hugging Face user.

### Space creation settings

#### Owner

By default, the Space will be created in under your personal account.

If you are part of some Hugging Face organizations and have enough rights you will see them in the dropdown list. If you select an organization, the Space will be created under `https://huggingface.co/spaces/{organization_name}/`.

#### Space hardware

For most usages you can leave the default `CPU basic FREE` option. For usage with more than 50 annotators and large datasets, `CPU Upgrade PAID` is recommended.

#### Persistent Storage
By default, persistent storage is set to `Small PAID`, which is paid services, charged per hour of usage. This is the most important setting if you plan to use Argilla more than a few hours.

If you just want to quickly test or use Argilla for a few hours with the risk of loosing your datasets, choose `Ephemeral FREE`.

!!! warning "Ephemeral persistent storage"
Not setting persistent storage to `Small` means that **you will loose your data when the Space restarts**.

#### Space Secrets

By default Argilla Spaces are configured with a sign in with Hugging Face button.

!!! info "Creating a Space under your personal account"
If you are creating the Space under your personal account, **don't insert any value for `USERNAME` and `PASSWORD`**. Once you launch the Space you will be able to Sign in with your Hugging Face username and the `owner` role.

!!! info "Creating a Space under an organization"
If you are creating the Space under an organization **make sure to insert your Hugging Face username in the secret `USERNAME`**. In this way, you'll be able to Sign in with your Hugging Face user.

## Connect to a private Space with the SDK
If you are using a private Hugging Face Space, you need to specify your `HF_TOKEN` which can be found [here](https://huggingface.co/settings/tokens).

```python
import argilla as rg

HF_TOKEN = "..."

client = rg.Argilla(
api_url="<api_url>",
api_key="<api_key>"
headers={"Authorization": f"Bearer {HF_TOKEN}"}
)
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
description: Deploy Argilla with Docker
---

```console
docker run -d --name quickstart -p 6900:6900 argilla/argilla-quickstart:v2.0.0rc2
```
6 changes: 0 additions & 6 deletions argilla/docs/getting_started/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,6 @@ If you have already deployed Argilla Server, you can skip this step. Otherwise,

* Using a [HF Space](https://huggingface.co/new-space?template=argilla/argilla-template-space).

* Locally with Docker.

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

## Connect to the Argilla server

Get your `<api_url>`:
Expand Down
77 changes: 55 additions & 22 deletions argilla/docs/getting_started/quickstart.md
Original file line number Diff line number Diff line change
@@ -1,61 +1,94 @@
---
description: Quickstart of Argilla on how to create your first dataset.
description: Get started with Argilla in under 10 minutes
---

# Quickstart

This guide provides a quick overview of the Argilla SDK and how to create your first dataset.
Argilla is a free, open-source, self-hosted tool. This means you need to deploy its server to start using it. There is two main ways to deploy Argilla:

## Setting up your Argilla project
!!! huggingface "Deploy on the Hugging Face Hub"

### Run the Argilla server
The **recommended choice to get started**. You can get up and running in under 5 minutes and don't need to maintain a server or run any commands.

If you're just getting started with Argilla, you need to click the button below and:

If you have already deployed Argilla Server, you can skip this step. Otherwise, you can quickly deploy it in two different ways:
- Leave the default Space owner (your personal account)
- Leave the `USERNAME` and `PASSWORD` Space secrets empty, you'll be able to sign in as Argilla owner with your HF user so you don't need a username and password.
- Set the Space to public, click create Space to launch Argilla 🚀.
- It will take a couple of minutes and once you see the Argilla UI [go to this section](#sign-in-into-the-argilla-ui)

* Remotely using a [HF Space](https://huggingface.co/new-space?template=argilla/argilla-template-space). Check out the [full guide](huggingface-spaces.md) for a more detailed configuration.
<div style="margin: 5px">
<a href="http://huggingface.co/new-space?template=argilla/argilla-template-space" target="_blank">
<img src="https://huggingface.co/datasets/huggingface/badges/raw/main/deploy-to-spaces-lg.svg" />
</a>
</div>

* Locally using Docker.
!!! warning "Persistent storage"
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 plan to **use the Argilla Space beyond testing**, it's highly recommended to **set persistent storage to `Small`**.
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).

!!! docker "Deploy with Docker"
If you want to run Argilla locally on your machine or a server, or tune the server configuration, choose this option. To use this option, [check this guide](how-to-deploy-argilla-with-docker.md).

## Sign in into the Argilla UI
If everything went well, you should see the Argilla sign in page that looks like this:

**TODO** add login page image

!!! info "Building errors"
If you get a build error, sometimes restarting the Space from the Settings page works, otherwise [check the HF Spaces settings guide](how-to-configure-argilla-on-huggingface.md).

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

After succesfully running this step, you should be able to see Argilla's UI sign in page (e.g., at the URL https://localhost:6900 if you ran the local Docker option).
You need to:

!!! tip "Default user credentials to log into the UI"
1. Click on **Sign in with Hugging Face**
2. **Authorize the application** and you should see the home page of Argilla

This type of deployment automatically sets up some default users for you. Check [this guide](../how-to-guides/user.md) to log in for the first time in the UI.
!!! info "Unauthorized error"
Sometimes, after granting permissions you'll see an unauthorized error, and get redirected to the sign in page. Typically, clicking the Sign in button solves the issue.

### Install the SDK with pip
Congrats! Your Argilla server is ready to start your first project using the Python SDK. Follow the instructions in the home page, or keep reading this guide if you want a more detailed explanation.

To manage users, workspaces and datasets in Argilla, you need to use the Argilla Python SDK. You can install it with pip as follows:
## Install the Python SDK

To manage users, workspaces, and datasets in Argilla, you need to use the Argilla Python SDK. You can install it with pip as follows:

```console
pip install argilla
```

### Connect to the Argilla server
## Create your first dataset using the SDK
For getting started with Argilla and its SDK, we highly recommend you to use Jupyter Notebook or online notebooks like Google Colab.

To start interacting with your Argilla server, you need to create a client using the API key and the API URL of your Argilla Server.

Get your `<api_url>`:
You can find your `<api_key>` in the `My Settings` page of your Argilla

* If you are using Hugging Face Spaces, the URL should be constructed as follows: `https://[your-owner-name]-[your_space_name].hf.space`
* If you are using Docker, the URL is the URL shown in your browser (by default `http://localhost:6900`)
The `<api_url>` is the URL shown in your browser if it ends with `*.hf.space`.

Get your `<api_key>` in `My Settings` in the Argilla UI (by default `owner.apikey`).
!!! info "Find out your API URL"
If you're using Spaces, sometimes the Argilla UI is embedded into the Hub UI so the URL of the browser won't match the API URL. In these scenarios, there are two options:
1. Click on the three points menu at the top of the Space, select "Embed this Space", and open the direct URL.
2. Write it following this pattern: `https://[your-owner-name]-[your_space_name].hf.space`.

!!! note
Make sure to replace `<api_url>` and `<api_key>` with your actual values. If you are using a private Hugging Face Space, you need to specify your `HF_TOKEN` which can be found [here](https://huggingface.co/settings/tokens).
Make sure to replace `<api_url>` and `<api_key>` with your actual values.

Then run:

```python
import argilla as rg

client = rg.Argilla(
api_url="<api_url>",
api_key="<api_key>"
# headers={"Authorization": f"Bearer {HF_TOKEN}"}
)
```



## Create your first dataset

To create a dataset with a simple text classification task, first, you need to define the dataset settings.
Expand Down
2 changes: 1 addition & 1 deletion argilla/docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Argilla is a **collaboration tool for AI engineers and domain experts** to build

---

Deploy Argilla for free on Hugging Face or with `Docker`. Install the Python client with `pip` and create your first project.
Deploy Argilla for free on the Hugging Face Hub or with `Docker`. Install the Python SDK with `pip` and create your first project.

[:octicons-arrow-right-24: Quickstart](getting_started/quickstart.md)

Expand Down
56 changes: 54 additions & 2 deletions argilla/docs/stylesheets/extra.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

:root {
--md-text-font: "Inter";
}
--md-admonition-icon--huggingface: url("https://cdn-lfs.huggingface.co/repos/96/a2/96a2c8468c1546e660ac2609e49404b8588fcf5a748761fa72c154b2836b4c83/942cad1ccda905ac5a659dfd2d78b344fccfb84a8a3ac3721e08f488205638a0?response-content-disposition=inline%3B+filename*%3DUTF-8%27%27hf-logo.svg%3B+filename%3D%22hf-logo.svg%22%3B&response-content-type=image%2Fsvg%2Bxml&Expires=1722181662&Policy=eyJTdGF0ZW1lbnQiOlt7IkNvbmRpdGlvbiI6eyJEYXRlTGVzc1RoYW4iOnsiQVdTOkVwb2NoVGltZSI6MTcyMjE4MTY2Mn19LCJSZXNvdXJjZSI6Imh0dHBzOi8vY2RuLWxmcy5odWdnaW5nZmFjZS5jby9yZXBvcy85Ni9hMi85NmEyYzg0NjhjMTU0NmU2NjBhYzI2MDllNDk0MDRiODU4OGZjZjVhNzQ4NzYxZmE3MmMxNTRiMjgzNmI0YzgzLzk0MmNhZDFjY2RhOTA1YWM1YTY1OWRmZDJkNzhiMzQ0ZmNjZmI4NGE4YTNhYzM3MjFlMDhmNDg4MjA1NjM4YTA%7EcmVzcG9uc2UtY29udGVudC1kaXNwb3NpdGlvbj0qJnJlc3BvbnNlLWNvbnRlbnQtdHlwZT0qIn1dfQ__&Signature=g8HP86K%7EZWkNX8HqCJ02SSFnej3vWaw7A10Kxq4HA08u-QktmS2xhOyhKGDgctlqZZOW8G52TqlFjLrNTH7jnr2iqFOHvAqW%7Eh3CDgtopT4VNUwyoXKnidqgv89ZSm6lFN1ws6tlF2UVHJPtlru6MJZ2ZyE2OnnWBB1RbYj-T-ETA05yVDyACBX7ZubgiRdRb3%7EGwpBmLV9YdiFRZqNIrW3McHP07Z2b076F2AAcraA8l0jN12it7U%7EG7sDQ7wL1htZGX9-QoVoMBZli-70SSdcF8UwNw1kwI%7EUdNbDm9Xnp7covMf-2paXqsVPbLPWCckaWNcedxhG1aczzJwKB9Q__&Key-Pair-Id=K3ESJI6DHPFC7");
--md-admonition-icon--docker: url("../assets/docker-mark-blue.svg");
}

[data-md-color-scheme="default"] {
--md-typeset-a-code-color: var(--md-default-fg-color--light);
Expand All @@ -26,4 +28,54 @@

.md-typeset a:hover code {
color: var(--md-accent-typeset-a-code-color);
}
}

.md-typeset .admonition.huggingface,
.md-typeset details.huggingface {
border-color: #FFD21E;
font-size: 100%;
}
.md-typeset .huggingface > .admonition-title,
.md-typeset .huggingface > summary {
background-color: #fcf1c7;
font-size: 18px;
}
.md-typeset .admonition.huggingface > .admonition-title::before {
content: "";
display: inline-block;
width: 24px;
height: 24px;
margin-right: 8px;
background-image: var(--md-admonition-icon--huggingface);
background-size: contain;
background-repeat: no-repeat;
background-position: center;
-webkit-mask-image: none; /* Remove any mask image */
mask-image: none; /* Remove any mask image */
background-color: transparent; /* Ensure background color is transparent */
}


.md-typeset .admonition.docker,
.md-typeset details.docker {
border-color: #1e5eff;
}
.md-typeset .docker > .admonition-title,
.md-typeset .docker > summary {
background-color: #c7e4fc;
}
.md-typeset .admonition.docker > .admonition-title::before {
content: "";
display: inline-block;
width: 24px;
height: 24px;
margin-right: 8px;
background-image: var(--md-admonition-icon--docker);
background-size: contain;
background-repeat: no-repeat;
background-position: center;
-webkit-mask-image: none; /* Remove any mask image */
mask-image: none; /* Remove any mask image */
background-color: transparent; /* Ensure background color is transparent */
}

0 comments on commit 65419a4

Please sign in to comment.