community-efforts/prompt_translation/02_upload_prompt_translation_data.ipynb (1,458 lines of code) (raw):
{
"cells": [
{
"cell_type": "markdown",
"metadata": {
"colab_type": "text",
"id": "view-in-github"
},
"source": [
"<a href=\"https://colab.research.google.com/github/huggingface/data-is-better-together/blob/main/prompt_translation/02_upload_prompt_translation_data.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# 2. Uploading prompts to be translated to an Argilla Space \n",
"\n",
"This notebook focuses on the steps involved in uploading prompts to be translated to an Argilla Space. It assumes you have already created an Argilla Space and have the Space ID and API key. If you haven't created an Argilla Space yet, please refer to the previous notebooks and the overall README for instructions on how to do so."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Steps\n",
"\n",
"This notebook picks up from the previous notebook in which you setup an Argilla Space with Oauth authentication and requested an upgrade to persistent storage. In this notebook we'll finish the setup instructions by covering the following steps. \n",
"\n",
"1. Loading the DIBT data into the Argilla Space\n",
"2. (Optional) machine translating the prompts to the target language as a starting point"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Install the required libraries by running the cell below."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "vE6ZR6hvSYVa",
"outputId": "f894056e-4182-4b82-dba5-dd13250a6334"
},
"outputs": [],
"source": [
"%pip install huggingface_hub argilla datasets openai -qqq"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "K0q42ZS-SYVi"
},
"source": [
"## Load the DIBT data into the Argilla Space\n",
"\n",
"\n",
"First we need to set up the Argilla SDK client with the URL and owner credentials for our space"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<div class=\"alert alert-warning\">\n",
" <strong>Warning!</strong> Make sure you have persistent storage enabled before you proceed to the next steps, if you haven't done this there is a strong danger of losing data. Please reach out on Discord to make sure this step has been done!\n",
"</div>"
]
},
{
"cell_type": "code",
"execution_count": 22,
"metadata": {},
"outputs": [],
"source": [
"import json"
]
},
{
"cell_type": "code",
"execution_count": 16,
"metadata": {},
"outputs": [],
"source": [
"SPACE_ID = \"DIBT-for-Esperanto/prompt-translation-for-Esperanto\"\n",
"HOMEPAGE_URL = \"https://dibt-for-esperanto-prompt-translation-for-esperanto.hf.space\"\n",
"LANGUAGE = None, # i.e. \"French\""
]
},
{
"cell_type": "code",
"execution_count": 27,
"metadata": {},
"outputs": [],
"source": [
"assert SPACE_ID and HOMEPAGE_URL and LANGUAGE, \"Please set SPACE_ID and HOMEPAGE_URL to your space ID and homepage URL\""
]
},
{
"cell_type": "code",
"execution_count": 18,
"metadata": {},
"outputs": [],
"source": [
"from huggingface_hub import space_info\n",
"\n",
"\n",
"assert space_info(SPACE_ID).runtime.storage.get(\"current\") == \"small\", \"Please ensure you have setup persistent storage for your space. Please see steps above\""
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "cBlFEFrOSYVj"
},
"outputs": [],
"source": [
"import argilla as rg\n",
"\n",
"OWNER_API_KEY = \"owner.apikey\" # if you haven't setup the secret this is the default owner api key\n",
"assert OWNER_API_KEY is not None, \"Please set OWNER_API_KEY to the API token you just set in the Space settings\"\n",
"\n",
"rg.init(api_url=HOMEPAGE_URL, api_key=OWNER_API_KEY)"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "E1emV7vsnni6"
},
"source": [
"Finally, we're ready to create our dataset in the `admin` workspace. To test that everything is working let's upload the original dataset (without translation), you can later delete this dataset from the UI or via the SDK."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "T9ZPKqfbSYVi"
},
"outputs": [],
"source": [
"from datasets import load_dataset\n",
"\n",
"# load the dataset from the Hub\n",
"ds = load_dataset('data-is-better-together/prompts_ranked_multilingual_benchmark')"
]
},
{
"cell_type": "code",
"execution_count": 21,
"metadata": {
"id": "J7RsrR_FSYVj"
},
"outputs": [
{
"data": {
"text/plain": [
"FeedbackDataset(\n",
" fields=[TextField(name='source', title='Source', required=True, type='text', use_markdown=True)]\n",
" questions=[TextQuestion(name='target', title='Target', description='Translate the text.', required=True, type='text', use_markdown=True)]\n",
" guidelines=This is a translation dataset that contains texts. Please translate the text in the text field.)\n",
" metadata_properties=[])\n",
" vectors_settings=[])\n",
")"
]
},
"execution_count": 21,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# create the dataset with a pre-built template\n",
"argilla_ds = rg.FeedbackDataset.for_translation(\n",
" use_markdown=True,\n",
" guidelines=None,\n",
" metadata_properties=None,\n",
" vectors_settings=None,\n",
")\n",
"argilla_ds"
]
},
{
"cell_type": "code",
"execution_count": 23,
"metadata": {
"id": "PueBot0ASYVk"
},
"outputs": [],
"source": [
"# create records\n",
"records = []\n",
"for row in ds[\"train\"]:\n",
" record = rg.FeedbackRecord(\n",
" fields={\"source\": row[\"prompt\"]},\n",
" metadata=json.loads(row[\"metadata\"]),\n",
" external_id=row[\"row_idx\"],\n",
" )\n",
" records.append(record)"
]
},
{
"cell_type": "code",
"execution_count": 24,
"metadata": {
"id": "-X1DE_6sSYVk"
},
"outputs": [],
"source": [
"# add records to the dataset\n",
"argilla_ds.add_records(records)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "tWJQ3FVESYVj"
},
"outputs": [],
"source": [
"# push the dataset to Argilla\n",
"argilla_ds.push_to_argilla(f\"DIBT Translation for {LANGUAGE}\", workspace=\"admin\")"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "l4qb3DNjoJpF"
},
"source": [
"At this point, the dataset is available in the UI. To be able to delete you need to log in with the user `owner` and the password you have setup in the secrets or the default one which is `12345678` if you haven't added the secret."
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "Ar94PbRHoerN"
},
"source": [
"## Translate the source dataset and push it to Argilla\n",
"\n",
"The only remaining step is to translate the dataset and create the final dataset your contributors will be annotating.\n",
"\n",
"There are different options to translate the dataset, such as:\n",
"\n",
"- Using Open Source models, like: nllb-200, Google-T5, OPUS-MT\n",
"- Using Closed LLM API providers like OpenAI with gpt-4-turbo or Mistral with mistral-large\n",
"\n",
"### Translation models\n",
"\n",
"#### Open Source models\n",
"\n",
"We will first start with an example of a translation pipeline with open source models. Even though these models are able to run on CPU it is highly recommended to use a GPU in order to speed up inference.\n",
"\n",
"We will use the [No Language Left Behind (NLLB) intiative from Meta](https://ai.meta.com/blog/nllb-200-high-quality-machine-translation/). A distilled version of this [model is available on Hugging Face](https://huggingface.co/facebook/nllb-200-distilled-600M). This model workd accross 200 different language and their language codes can be found in [this readme](https://huggingface.co/facebook/nllb-200-distilled-600M/blob/main/README.md).\n",
"\n",
"First, we will initialize the model with a correct `src_lang`."
]
},
{
"cell_type": "code",
"execution_count": 31,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Successfully installed accelerate-0.28.0 mpmath-1.3.0 networkx-3.2.1 safetensors-0.4.2 sympy-1.12 tokenizers-0.15.2 torch-2.2.1 transformers-4.39.0\n"
]
}
],
"source": [
"# !pip install 'transformers[torch]'"
]
},
{
"cell_type": "code",
"execution_count": 32,
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "MNh3GmQH4yu1",
"outputId": "401e0427-3bb1-4499-c43a-e1a5295d8e77"
},
"outputs": [],
"source": [
"from transformers import AutoModelForSeq2SeqLM, AutoTokenizer\n",
"import torch\n",
"\n",
"model_path = \"facebook/nllb-200-distilled-600M\"\n",
"tokenizer = AutoTokenizer.from_pretrained(model_path, src_lang=\"eng_Latn\")\n",
"model = AutoModelForSeq2SeqLM.from_pretrained(model_path)\n",
"\n",
"# Check if a GPU is available\n",
"device = \"cuda\" if torch.cuda.is_available() else \"cpu\"\n",
"\n",
"# Move the model and tokenizer to the GPU if available\n",
"model = model.to(device)"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "hvN_nosG_B_v"
},
"source": [
"Next, we will define a translation function that takes a `text: Union[str, List[str]]` and a correct `trg_lang`."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/",
"height": 54
},
"id": "2E-54M746b0g",
"outputId": "99e012a0-524e-4e59-e827-f60452cdb5a2"
},
"outputs": [],
"source": [
"def open_translate(texts, trg_lang):\n",
" if isinstance(texts, str): # If a single text is provided, convert it to a list\n",
" texts = [texts]\n",
"\n",
" inputs = tokenizer(texts, return_tensors=\"pt\", padding=True, truncation=True)\n",
" translated_tokens = model.generate(\n",
" **inputs.to(device), forced_bos_token_id=tokenizer.lang_code_to_id[trg_lang]\n",
" )\n",
" translations = tokenizer.batch_decode(translated_tokens, skip_special_tokens=True)\n",
"\n",
" if len(translations) == 1:\n",
" return translations[0]\n",
" else:\n",
" return translations\n",
"\n",
"\n",
"example = \"We will first start with an example of a translation pipeline with open source models. Even though these models are able to run on CPU it is highly recommended to use a GPU in order to speed up inference.\"\n",
"open_translate(example, \"spa_Latn\")"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "89jGGUNs_WTQ"
},
"source": [
"#### Other models and closed source LLM API providers\n",
"\n",
"Depending on the language you are working in the NLLB model used above might not work so well. One alternative is to use a specific translation model for your language. You can find many of these on the Hugging Face Hub with examples showing how to use them. Alternatively, you might use a closed LLM provider. We provide a separate example of using one of these notebooks [here](https://github.com/huggingface/data-is-better-together/blob/main/prompt_translation/Translation_with_distilabel_gpt_4_turbo.ipynb). If you want to use this alternative approach you may want to jump straight to that notebook and skip the rest of this notebook!"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "8jvNmvWSChP3"
},
"source": [
"### Add translations as suggestions\n",
"\n",
"Now, we will use the defined translation functions to add some pre-filled translation suggestions to the Argilla dataset."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "w5NQspY4CetP"
},
"outputs": [],
"source": [
"argilla_ds = rg.FeedbackDataset.from_argilla(f\"DIBT Translation for {LANGUAGE}\", workspace=\"admin\")\n",
"argilla_ds"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "XDusjXAZGXTm"
},
"source": [
"Next, we will loop through the records and add a translation."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"from tqdm.auto import tqdm"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "U6AHHnHdGW7p"
},
"outputs": [],
"source": [
"altered_records = []\n",
"for rec in tqdm(argilla_ds.records):\n",
" rec.suggestions = [\n",
" {\n",
" \"question_name\": \"target\",\n",
" \"value\": open_translate(rec.fields[\"source\"], \"spa_Latn\")\n",
" }\n",
" ]\n",
" altered_records.append(rec)"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "GzAnL3WmG7Le"
},
"source": [
"Lastly, we will update these records within Argilla."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# Example of doing this with a closed model\n",
"# altered_records = []\n",
"# for rec in tqdm(argilla_ds.records):\n",
"# rec.suggestions = [\n",
"# {\n",
"# \"question_name\": \"target\",\n",
"# \"value\": closed_translate(\n",
"# rec.fields[\"source\"],\n",
"# \"spa_Latn\",\n",
"# max_tokens=len(rec.fields[\"source\"]) + 10,\n",
"# ),\n",
"# }\n",
"# ]\n",
"# altered_records.append(rec)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "Jt5FChJwGSrv"
},
"outputs": [],
"source": [
"argilla_ds.update_records(altered_records)"
]
}
],
"metadata": {
"colab": {
"include_colab_link": true,
"provenance": []
},
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.1"
},
"widgets": {
"application/vnd.jupyter.widget-state+json": {
"09fc1c480cfd4c73b55457ff8f502d1f": {
"model_module": "@jupyter-widgets/base",
"model_module_version": "1.2.0",
"model_name": "LayoutModel",
"state": {
"_model_module": "@jupyter-widgets/base",
"_model_module_version": "1.2.0",
"_model_name": "LayoutModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "LayoutView",
"align_content": null,
"align_items": null,
"align_self": null,
"border": null,
"bottom": null,
"display": null,
"flex": null,
"flex_flow": null,
"grid_area": null,
"grid_auto_columns": null,
"grid_auto_flow": null,
"grid_auto_rows": null,
"grid_column": null,
"grid_gap": null,
"grid_row": null,
"grid_template_areas": null,
"grid_template_columns": null,
"grid_template_rows": null,
"height": null,
"justify_content": null,
"justify_items": null,
"left": null,
"margin": null,
"max_height": null,
"max_width": null,
"min_height": null,
"min_width": null,
"object_fit": null,
"object_position": null,
"order": null,
"overflow": null,
"overflow_x": null,
"overflow_y": null,
"padding": null,
"right": null,
"top": null,
"visibility": null,
"width": null
}
},
"0b61dbb4bfee479abe359c31d13f47ed": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "1.5.0",
"model_name": "DescriptionStyleModel",
"state": {
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "DescriptionStyleModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "StyleView",
"description_width": ""
}
},
"11f01153faf247409124fdb7b5dbeecc": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "1.5.0",
"model_name": "DescriptionStyleModel",
"state": {
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "DescriptionStyleModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "StyleView",
"description_width": ""
}
},
"12090bea5a4047328badf91a2bb5fffe": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "1.5.0",
"model_name": "PasswordModel",
"state": {
"_dom_classes": [],
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "PasswordModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/controls",
"_view_module_version": "1.5.0",
"_view_name": "PasswordView",
"continuous_update": true,
"description": "Token:",
"description_tooltip": null,
"disabled": false,
"layout": "IPY_MODEL_b411ce99fffa412882b67e096c1f97e7",
"placeholder": "",
"style": "IPY_MODEL_2520720723cb41f1be12a989f560a8d6",
"value": ""
}
},
"214e265805b540908004c8d7d3aee560": {
"model_module": "@jupyter-widgets/base",
"model_module_version": "1.2.0",
"model_name": "LayoutModel",
"state": {
"_model_module": "@jupyter-widgets/base",
"_model_module_version": "1.2.0",
"_model_name": "LayoutModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "LayoutView",
"align_content": null,
"align_items": null,
"align_self": null,
"border": null,
"bottom": null,
"display": null,
"flex": null,
"flex_flow": null,
"grid_area": null,
"grid_auto_columns": null,
"grid_auto_flow": null,
"grid_auto_rows": null,
"grid_column": null,
"grid_gap": null,
"grid_row": null,
"grid_template_areas": null,
"grid_template_columns": null,
"grid_template_rows": null,
"height": null,
"justify_content": null,
"justify_items": null,
"left": null,
"margin": null,
"max_height": null,
"max_width": null,
"min_height": null,
"min_width": null,
"object_fit": null,
"object_position": null,
"order": null,
"overflow": null,
"overflow_x": null,
"overflow_y": null,
"padding": null,
"right": null,
"top": null,
"visibility": null,
"width": null
}
},
"2520720723cb41f1be12a989f560a8d6": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "1.5.0",
"model_name": "DescriptionStyleModel",
"state": {
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "DescriptionStyleModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "StyleView",
"description_width": ""
}
},
"275eb6b8cc6b41c9b8d827e4bde0d378": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "1.5.0",
"model_name": "LabelModel",
"state": {
"_dom_classes": [],
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "LabelModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/controls",
"_view_module_version": "1.5.0",
"_view_name": "LabelView",
"description": "",
"description_tooltip": null,
"layout": "IPY_MODEL_214e265805b540908004c8d7d3aee560",
"placeholder": "",
"style": "IPY_MODEL_0b61dbb4bfee479abe359c31d13f47ed",
"value": "Token is valid (permission: write)."
}
},
"280781fd383040f08e7f00a8f06c6e65": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "1.5.0",
"model_name": "CheckboxModel",
"state": {
"_dom_classes": [],
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "CheckboxModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/controls",
"_view_module_version": "1.5.0",
"_view_name": "CheckboxView",
"description": "Add token as git credential?",
"description_tooltip": null,
"disabled": false,
"indent": true,
"layout": "IPY_MODEL_31cb03323cd245f7ab05acb1d65b21ed",
"style": "IPY_MODEL_11f01153faf247409124fdb7b5dbeecc",
"value": true
}
},
"31cb03323cd245f7ab05acb1d65b21ed": {
"model_module": "@jupyter-widgets/base",
"model_module_version": "1.2.0",
"model_name": "LayoutModel",
"state": {
"_model_module": "@jupyter-widgets/base",
"_model_module_version": "1.2.0",
"_model_name": "LayoutModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "LayoutView",
"align_content": null,
"align_items": null,
"align_self": null,
"border": null,
"bottom": null,
"display": null,
"flex": null,
"flex_flow": null,
"grid_area": null,
"grid_auto_columns": null,
"grid_auto_flow": null,
"grid_auto_rows": null,
"grid_column": null,
"grid_gap": null,
"grid_row": null,
"grid_template_areas": null,
"grid_template_columns": null,
"grid_template_rows": null,
"height": null,
"justify_content": null,
"justify_items": null,
"left": null,
"margin": null,
"max_height": null,
"max_width": null,
"min_height": null,
"min_width": null,
"object_fit": null,
"object_position": null,
"order": null,
"overflow": null,
"overflow_x": null,
"overflow_y": null,
"padding": null,
"right": null,
"top": null,
"visibility": null,
"width": null
}
},
"376eb79e4c4043c78ef567ce1253b505": {
"model_module": "@jupyter-widgets/base",
"model_module_version": "1.2.0",
"model_name": "LayoutModel",
"state": {
"_model_module": "@jupyter-widgets/base",
"_model_module_version": "1.2.0",
"_model_name": "LayoutModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "LayoutView",
"align_content": null,
"align_items": null,
"align_self": null,
"border": null,
"bottom": null,
"display": null,
"flex": null,
"flex_flow": null,
"grid_area": null,
"grid_auto_columns": null,
"grid_auto_flow": null,
"grid_auto_rows": null,
"grid_column": null,
"grid_gap": null,
"grid_row": null,
"grid_template_areas": null,
"grid_template_columns": null,
"grid_template_rows": null,
"height": null,
"justify_content": null,
"justify_items": null,
"left": null,
"margin": null,
"max_height": null,
"max_width": null,
"min_height": null,
"min_width": null,
"object_fit": null,
"object_position": null,
"order": null,
"overflow": null,
"overflow_x": null,
"overflow_y": null,
"padding": null,
"right": null,
"top": null,
"visibility": null,
"width": null
}
},
"461d29cb2f4b4902a5647788fca3866c": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "1.5.0",
"model_name": "VBoxModel",
"state": {
"_dom_classes": [],
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "VBoxModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/controls",
"_view_module_version": "1.5.0",
"_view_name": "VBoxView",
"box_style": "",
"children": [
"IPY_MODEL_275eb6b8cc6b41c9b8d827e4bde0d378",
"IPY_MODEL_4dffe6d45db641a89116c7ee1929ac5e",
"IPY_MODEL_d36226937cdf47cebf7d9fdf38e2b1d7",
"IPY_MODEL_970864c7786f481bae9477e3388170c3"
],
"layout": "IPY_MODEL_4e4b6f913c3c4447accfa63def7fa8c8"
}
},
"4dffe6d45db641a89116c7ee1929ac5e": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "1.5.0",
"model_name": "LabelModel",
"state": {
"_dom_classes": [],
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "LabelModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/controls",
"_view_module_version": "1.5.0",
"_view_name": "LabelView",
"description": "",
"description_tooltip": null,
"layout": "IPY_MODEL_a484616854194f9d8d41da20968614d1",
"placeholder": "",
"style": "IPY_MODEL_f32b0cc0af914fedac3b4f54ae6ef040",
"value": "Your token has been saved in your configured git credential helpers (store)."
}
},
"4e4b6f913c3c4447accfa63def7fa8c8": {
"model_module": "@jupyter-widgets/base",
"model_module_version": "1.2.0",
"model_name": "LayoutModel",
"state": {
"_model_module": "@jupyter-widgets/base",
"_model_module_version": "1.2.0",
"_model_name": "LayoutModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "LayoutView",
"align_content": null,
"align_items": "center",
"align_self": null,
"border": null,
"bottom": null,
"display": "flex",
"flex": null,
"flex_flow": "column",
"grid_area": null,
"grid_auto_columns": null,
"grid_auto_flow": null,
"grid_auto_rows": null,
"grid_column": null,
"grid_gap": null,
"grid_row": null,
"grid_template_areas": null,
"grid_template_columns": null,
"grid_template_rows": null,
"height": null,
"justify_content": null,
"justify_items": null,
"left": null,
"margin": null,
"max_height": null,
"max_width": null,
"min_height": null,
"min_width": null,
"object_fit": null,
"object_position": null,
"order": null,
"overflow": null,
"overflow_x": null,
"overflow_y": null,
"padding": null,
"right": null,
"top": null,
"visibility": null,
"width": "50%"
}
},
"613c5fdd56e54ef38579b787b5f4b9e8": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "1.5.0",
"model_name": "LabelModel",
"state": {
"_dom_classes": [],
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "LabelModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/controls",
"_view_module_version": "1.5.0",
"_view_name": "LabelView",
"description": "",
"description_tooltip": null,
"layout": "IPY_MODEL_85e546cac5924efabf38f6b6a9ac4f6c",
"placeholder": "",
"style": "IPY_MODEL_e9b32b3539034739a3880feca4efbc51",
"value": "Connecting..."
}
},
"6557c8d05b374fb0aac69dab78e634cc": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "1.5.0",
"model_name": "HTMLModel",
"state": {
"_dom_classes": [],
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "HTMLModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/controls",
"_view_module_version": "1.5.0",
"_view_name": "HTMLView",
"description": "",
"description_tooltip": null,
"layout": "IPY_MODEL_376eb79e4c4043c78ef567ce1253b505",
"placeholder": "",
"style": "IPY_MODEL_a8ac61e1292c4a0a85765585eeed0a8c",
"value": "<center> <img\nsrc=https://huggingface.co/front/assets/huggingface_logo-noborder.svg\nalt='Hugging Face'> <br> Copy a token from <a\nhref=\"https://huggingface.co/settings/tokens\" target=\"_blank\">your Hugging Face\ntokens page</a> and paste it below. <br> Immediately click login after copying\nyour token or it might be stored in plain text in this notebook file. </center>"
}
},
"85e546cac5924efabf38f6b6a9ac4f6c": {
"model_module": "@jupyter-widgets/base",
"model_module_version": "1.2.0",
"model_name": "LayoutModel",
"state": {
"_model_module": "@jupyter-widgets/base",
"_model_module_version": "1.2.0",
"_model_name": "LayoutModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "LayoutView",
"align_content": null,
"align_items": null,
"align_self": null,
"border": null,
"bottom": null,
"display": null,
"flex": null,
"flex_flow": null,
"grid_area": null,
"grid_auto_columns": null,
"grid_auto_flow": null,
"grid_auto_rows": null,
"grid_column": null,
"grid_gap": null,
"grid_row": null,
"grid_template_areas": null,
"grid_template_columns": null,
"grid_template_rows": null,
"height": null,
"justify_content": null,
"justify_items": null,
"left": null,
"margin": null,
"max_height": null,
"max_width": null,
"min_height": null,
"min_width": null,
"object_fit": null,
"object_position": null,
"order": null,
"overflow": null,
"overflow_x": null,
"overflow_y": null,
"padding": null,
"right": null,
"top": null,
"visibility": null,
"width": null
}
},
"9028521ce1524686b72f5b885b67762c": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "1.5.0",
"model_name": "DescriptionStyleModel",
"state": {
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "DescriptionStyleModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "StyleView",
"description_width": ""
}
},
"970864c7786f481bae9477e3388170c3": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "1.5.0",
"model_name": "LabelModel",
"state": {
"_dom_classes": [],
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "LabelModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/controls",
"_view_module_version": "1.5.0",
"_view_name": "LabelView",
"description": "",
"description_tooltip": null,
"layout": "IPY_MODEL_09fc1c480cfd4c73b55457ff8f502d1f",
"placeholder": "",
"style": "IPY_MODEL_9028521ce1524686b72f5b885b67762c",
"value": "Login successful"
}
},
"a3431cefe6124ef2b154a7d744c437f7": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "1.5.0",
"model_name": "ButtonModel",
"state": {
"_dom_classes": [],
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "ButtonModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/controls",
"_view_module_version": "1.5.0",
"_view_name": "ButtonView",
"button_style": "",
"description": "Login",
"disabled": false,
"icon": "",
"layout": "IPY_MODEL_de5cf886e20443caba34cba6d9ec90ef",
"style": "IPY_MODEL_b3646a7cce5b421789306ec676fbdf2a",
"tooltip": ""
}
},
"a372c6a48e7b4d318ecbe495f4c51b4f": {
"model_module": "@jupyter-widgets/base",
"model_module_version": "1.2.0",
"model_name": "LayoutModel",
"state": {
"_model_module": "@jupyter-widgets/base",
"_model_module_version": "1.2.0",
"_model_name": "LayoutModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "LayoutView",
"align_content": null,
"align_items": null,
"align_self": null,
"border": null,
"bottom": null,
"display": null,
"flex": null,
"flex_flow": null,
"grid_area": null,
"grid_auto_columns": null,
"grid_auto_flow": null,
"grid_auto_rows": null,
"grid_column": null,
"grid_gap": null,
"grid_row": null,
"grid_template_areas": null,
"grid_template_columns": null,
"grid_template_rows": null,
"height": null,
"justify_content": null,
"justify_items": null,
"left": null,
"margin": null,
"max_height": null,
"max_width": null,
"min_height": null,
"min_width": null,
"object_fit": null,
"object_position": null,
"order": null,
"overflow": null,
"overflow_x": null,
"overflow_y": null,
"padding": null,
"right": null,
"top": null,
"visibility": null,
"width": null
}
},
"a484616854194f9d8d41da20968614d1": {
"model_module": "@jupyter-widgets/base",
"model_module_version": "1.2.0",
"model_name": "LayoutModel",
"state": {
"_model_module": "@jupyter-widgets/base",
"_model_module_version": "1.2.0",
"_model_name": "LayoutModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "LayoutView",
"align_content": null,
"align_items": null,
"align_self": null,
"border": null,
"bottom": null,
"display": null,
"flex": null,
"flex_flow": null,
"grid_area": null,
"grid_auto_columns": null,
"grid_auto_flow": null,
"grid_auto_rows": null,
"grid_column": null,
"grid_gap": null,
"grid_row": null,
"grid_template_areas": null,
"grid_template_columns": null,
"grid_template_rows": null,
"height": null,
"justify_content": null,
"justify_items": null,
"left": null,
"margin": null,
"max_height": null,
"max_width": null,
"min_height": null,
"min_width": null,
"object_fit": null,
"object_position": null,
"order": null,
"overflow": null,
"overflow_x": null,
"overflow_y": null,
"padding": null,
"right": null,
"top": null,
"visibility": null,
"width": null
}
},
"a8ac61e1292c4a0a85765585eeed0a8c": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "1.5.0",
"model_name": "DescriptionStyleModel",
"state": {
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "DescriptionStyleModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "StyleView",
"description_width": ""
}
},
"b3646a7cce5b421789306ec676fbdf2a": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "1.5.0",
"model_name": "ButtonStyleModel",
"state": {
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "ButtonStyleModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "StyleView",
"button_color": null,
"font_weight": ""
}
},
"b411ce99fffa412882b67e096c1f97e7": {
"model_module": "@jupyter-widgets/base",
"model_module_version": "1.2.0",
"model_name": "LayoutModel",
"state": {
"_model_module": "@jupyter-widgets/base",
"_model_module_version": "1.2.0",
"_model_name": "LayoutModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "LayoutView",
"align_content": null,
"align_items": null,
"align_self": null,
"border": null,
"bottom": null,
"display": null,
"flex": null,
"flex_flow": null,
"grid_area": null,
"grid_auto_columns": null,
"grid_auto_flow": null,
"grid_auto_rows": null,
"grid_column": null,
"grid_gap": null,
"grid_row": null,
"grid_template_areas": null,
"grid_template_columns": null,
"grid_template_rows": null,
"height": null,
"justify_content": null,
"justify_items": null,
"left": null,
"margin": null,
"max_height": null,
"max_width": null,
"min_height": null,
"min_width": null,
"object_fit": null,
"object_position": null,
"order": null,
"overflow": null,
"overflow_x": null,
"overflow_y": null,
"padding": null,
"right": null,
"top": null,
"visibility": null,
"width": null
}
},
"b6a7e58fae234c93a47d784de26bcf82": {
"model_module": "@jupyter-widgets/base",
"model_module_version": "1.2.0",
"model_name": "LayoutModel",
"state": {
"_model_module": "@jupyter-widgets/base",
"_model_module_version": "1.2.0",
"_model_name": "LayoutModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "LayoutView",
"align_content": null,
"align_items": null,
"align_self": null,
"border": null,
"bottom": null,
"display": null,
"flex": null,
"flex_flow": null,
"grid_area": null,
"grid_auto_columns": null,
"grid_auto_flow": null,
"grid_auto_rows": null,
"grid_column": null,
"grid_gap": null,
"grid_row": null,
"grid_template_areas": null,
"grid_template_columns": null,
"grid_template_rows": null,
"height": null,
"justify_content": null,
"justify_items": null,
"left": null,
"margin": null,
"max_height": null,
"max_width": null,
"min_height": null,
"min_width": null,
"object_fit": null,
"object_position": null,
"order": null,
"overflow": null,
"overflow_x": null,
"overflow_y": null,
"padding": null,
"right": null,
"top": null,
"visibility": null,
"width": null
}
},
"bfb294e558d54763913a9771dcfd9fc9": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "1.5.0",
"model_name": "DescriptionStyleModel",
"state": {
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "DescriptionStyleModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "StyleView",
"description_width": ""
}
},
"c9d3cf4b94db4ac4968e698f7399a77c": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "1.5.0",
"model_name": "DescriptionStyleModel",
"state": {
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "DescriptionStyleModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "StyleView",
"description_width": ""
}
},
"d36226937cdf47cebf7d9fdf38e2b1d7": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "1.5.0",
"model_name": "LabelModel",
"state": {
"_dom_classes": [],
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "LabelModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/controls",
"_view_module_version": "1.5.0",
"_view_name": "LabelView",
"description": "",
"description_tooltip": null,
"layout": "IPY_MODEL_a372c6a48e7b4d318ecbe495f4c51b4f",
"placeholder": "",
"style": "IPY_MODEL_bfb294e558d54763913a9771dcfd9fc9",
"value": "Your token has been saved to /root/.cache/huggingface/token"
}
},
"de5cf886e20443caba34cba6d9ec90ef": {
"model_module": "@jupyter-widgets/base",
"model_module_version": "1.2.0",
"model_name": "LayoutModel",
"state": {
"_model_module": "@jupyter-widgets/base",
"_model_module_version": "1.2.0",
"_model_name": "LayoutModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "LayoutView",
"align_content": null,
"align_items": null,
"align_self": null,
"border": null,
"bottom": null,
"display": null,
"flex": null,
"flex_flow": null,
"grid_area": null,
"grid_auto_columns": null,
"grid_auto_flow": null,
"grid_auto_rows": null,
"grid_column": null,
"grid_gap": null,
"grid_row": null,
"grid_template_areas": null,
"grid_template_columns": null,
"grid_template_rows": null,
"height": null,
"justify_content": null,
"justify_items": null,
"left": null,
"margin": null,
"max_height": null,
"max_width": null,
"min_height": null,
"min_width": null,
"object_fit": null,
"object_position": null,
"order": null,
"overflow": null,
"overflow_x": null,
"overflow_y": null,
"padding": null,
"right": null,
"top": null,
"visibility": null,
"width": null
}
},
"e9b32b3539034739a3880feca4efbc51": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "1.5.0",
"model_name": "DescriptionStyleModel",
"state": {
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "DescriptionStyleModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "StyleView",
"description_width": ""
}
},
"f32b0cc0af914fedac3b4f54ae6ef040": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "1.5.0",
"model_name": "DescriptionStyleModel",
"state": {
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "DescriptionStyleModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "StyleView",
"description_width": ""
}
},
"f86fb2fc6998436aa19cd1e9fa4d1d31": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "1.5.0",
"model_name": "HTMLModel",
"state": {
"_dom_classes": [],
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "HTMLModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/controls",
"_view_module_version": "1.5.0",
"_view_name": "HTMLView",
"description": "",
"description_tooltip": null,
"layout": "IPY_MODEL_b6a7e58fae234c93a47d784de26bcf82",
"placeholder": "",
"style": "IPY_MODEL_c9d3cf4b94db4ac4968e698f7399a77c",
"value": "\n<b>Pro Tip:</b> If you don't already have one, you can create a dedicated\n'notebooks' token with 'write' access, that you can then easily reuse for all\nnotebooks. </center>"
}
}
}
}
},
"nbformat": 4,
"nbformat_minor": 4
}