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

fix: update field name in metadata for image url #2609

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