Skip to content

Commit

Permalink
fix: update field name in metadata for image url (#2609)
Browse files Browse the repository at this point in the history
# Description

This pull request aligns the image classification tutorial with the
correct implementation by displaying images from a URL on the front end.

- i.e. `_image_url` in metadata.
- install instructions are returned to standard.

Closes #2592 

**Type of change**

(Please delete options that are not relevant. Remember to title the PR
according to the type of change)

- [x] Bug fix (non-breaking change which fixes an issue)

**How Has This Been Tested**

The notebook has been run with a release v1.5.0 instance of Argilla.

**Checklist**
  • Loading branch information
burtenshaw authored Mar 28, 2023
1 parent f046c5b commit b7a821c
Showing 1 changed file with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"## Running (Forked) Argilla with image hack\n",
"## Running Argilla\n",
"\n",
"For this tutorial, you will need to have an Argilla server running. There are two main options for deploying and running Argilla:\n",
"\n",
"1. [Deploy Argilla on Hugging Face Spaces](https://huggingface.co/docs/hub/spaces-sdks-docker-argilla): This is the fastest option and the recommended choice for connecting to external notebooks (e.g., Google Colab) if you have an account on Hugging Face. You can deploy the image hack version of Argilla on Hugging Face Spaces by by duplicating [this space](https://huggingface.co/spaces/burtenshaw/argilla-image) . \n",
"1. [Deploy Argilla on Hugging Face Spaces](https://huggingface.co/docs/hub/spaces-sdks-docker-argilla): This is the fastest option and the recommended choice for connecting to external notebooks (e.g., Google Colab) if you have an account on Hugging Face.\n",
"\n",
"2. [Launch Argilla using a customised quickstart Docker image](../../getting_started/quickstart.ipynb): This is the recommended option if you want Argilla running on your local machine. The image hack version of Argilla is available on Docker Hub as `burtenshaw/argilla-image`. \n",
"2. [Launch Argilla using Argilla's quickstart Docker image](../../getting_started/quickstart.ipynb): This is the recommended option if you want Argilla running on your local machine. Note that this option will only let you run the tutorial locally and not with an external notebook service.\n",
"\n",
"For more information on deployment options, please check the Deployment section of the documentation.\n",
"\n",
Expand Down Expand Up @@ -135,6 +135,7 @@
"metadata": {},
"outputs": [],
"source": [
"import os\n",
"import pprint as pp\n",
"from requests import get\n",
"\n",
Expand Down Expand Up @@ -792,11 +793,14 @@
},
"outputs": [],
"source": [
"# we need to set the metadata field length to 200 for longer urls\n",
"os.environ[\"ARGILLA_METADATA_FIELD_LENGTH\"] = \"200\"\n",
"\n",
"# instantiate Argilla records with vectors\n",
"records = [\n",
" rg.TextClassificationRecord(\n",
" text=sample[\"page_name\"],\n",
" metadata=dict(image_path=sample[\"image_url\"]),\n",
" metadata=dict(_image_url=sample[\"image_url\"]),\n",
" vectors=sample[\"vectors\"]\n",
" )\n",
" for sample in dataset\n",
Expand Down

0 comments on commit b7a821c

Please sign in to comment.