Ramzan0553 commited on
Commit
df32b86
Β·
verified Β·
1 Parent(s): 3610d71

Upload 3 files

Browse files
CLIP_Model.ipynb ADDED
@@ -0,0 +1 @@
 
 
1
+ {"nbformat":4,"nbformat_minor":0,"metadata":{"colab":{"provenance":[]},"kernelspec":{"name":"python3","display_name":"Python 3"},"language_info":{"name":"python"}},"cells":[{"cell_type":"code","execution_count":null,"metadata":{"id":"h7zlX1qoEmDA"},"outputs":[],"source":["!pip install gradio transformers datasets torchvision"]},{"cell_type":"code","source":["import os\n","import pandas as pd\n","import torch\n","from PIL import Image\n","from transformers import CLIPProcessor, CLIPModel\n","import gradio as gr\n","from tqdm import tqdm"],"metadata":{"id":"jRqPayqIEvYS"},"execution_count":null,"outputs":[]},{"cell_type":"code","source":["from google.colab import drive\n","drive.mount('/content/drive')\n","\n","# -------------------- Paths --------------------\n","MODEL_PATH = \"/content/drive/My Drive/CLIP_Project/Model_Files\"\n","CSV_PATH = \"/content/drive/My Drive/CLIP_Project/Data/results.csv\"\n","IMG_DIR = \"/content/drive/My Drive/CLIP_Project/Data/Images\"\n","NUM_IMAGES = 1000"],"metadata":{"id":"BVabhv7aE4fU","colab":{"base_uri":"https://localhost:8080/"},"executionInfo":{"status":"ok","timestamp":1748779541133,"user_tz":-300,"elapsed":47192,"user":{"displayName":"Ramzan0001","userId":"17484931948124609414"}},"outputId":"93768d9c-75f8-45f3-fe82-67f6099c0f07"},"execution_count":null,"outputs":[{"output_type":"stream","name":"stdout","text":["Mounted at /content/drive\n"]}]},{"cell_type":"code","source":["device = torch.device(\"cuda\" if torch.cuda.is_available() else \"cpu\")"],"metadata":{"id":"pf2bfspKEyNv"},"execution_count":null,"outputs":[]},{"cell_type":"code","source":["# -------------------- Load Model --------------------\n","model = CLIPModel.from_pretrained(MODEL_PATH).to(device)\n","processor = CLIPProcessor.from_pretrained(MODEL_PATH)\n","model.eval()"],"metadata":{"id":"5ijAU5m3E_US","colab":{"base_uri":"https://localhost:8080/"},"executionInfo":{"status":"ok","timestamp":1748779579329,"user_tz":-300,"elapsed":17237,"user":{"displayName":"Ramzan0001","userId":"17484931948124609414"}},"outputId":"b8cb675f-c784-4508-e269-88752e9b507d"},"execution_count":null,"outputs":[{"output_type":"stream","name":"stderr","text":["Using a slow image processor as `use_fast` is unset and a slow processor was saved with this model. `use_fast=True` will be the default behavior in v4.52, even if the model was saved with a slow processor. This will result in minor differences in outputs. You'll still be able to use a slow processor with `use_fast=False`.\n"]},{"output_type":"execute_result","data":{"text/plain":["CLIPModel(\n"," (text_model): CLIPTextTransformer(\n"," (embeddings): CLIPTextEmbeddings(\n"," (token_embedding): Embedding(49408, 512)\n"," (position_embedding): Embedding(77, 512)\n"," )\n"," (encoder): CLIPEncoder(\n"," (layers): ModuleList(\n"," (0-11): 12 x CLIPEncoderLayer(\n"," (self_attn): CLIPAttention(\n"," (k_proj): Linear(in_features=512, out_features=512, bias=True)\n"," (v_proj): Linear(in_features=512, out_features=512, bias=True)\n"," (q_proj): Linear(in_features=512, out_features=512, bias=True)\n"," (out_proj): Linear(in_features=512, out_features=512, bias=True)\n"," )\n"," (layer_norm1): LayerNorm((512,), eps=1e-05, elementwise_affine=True)\n"," (mlp): CLIPMLP(\n"," (activation_fn): QuickGELUActivation()\n"," (fc1): Linear(in_features=512, out_features=2048, bias=True)\n"," (fc2): Linear(in_features=2048, out_features=512, bias=True)\n"," )\n"," (layer_norm2): LayerNorm((512,), eps=1e-05, elementwise_affine=True)\n"," )\n"," )\n"," )\n"," (final_layer_norm): LayerNorm((512,), eps=1e-05, elementwise_affine=True)\n"," )\n"," (vision_model): CLIPVisionTransformer(\n"," (embeddings): CLIPVisionEmbeddings(\n"," (patch_embedding): Conv2d(3, 768, kernel_size=(32, 32), stride=(32, 32), bias=False)\n"," (position_embedding): Embedding(50, 768)\n"," )\n"," (pre_layrnorm): LayerNorm((768,), eps=1e-05, elementwise_affine=True)\n"," (encoder): CLIPEncoder(\n"," (layers): ModuleList(\n"," (0-11): 12 x CLIPEncoderLayer(\n"," (self_attn): CLIPAttention(\n"," (k_proj): Linear(in_features=768, out_features=768, bias=True)\n"," (v_proj): Linear(in_features=768, out_features=768, bias=True)\n"," (q_proj): Linear(in_features=768, out_features=768, bias=True)\n"," (out_proj): Linear(in_features=768, out_features=768, bias=True)\n"," )\n"," (layer_norm1): LayerNorm((768,), eps=1e-05, elementwise_affine=True)\n"," (mlp): CLIPMLP(\n"," (activation_fn): QuickGELUActivation()\n"," (fc1): Linear(in_features=768, out_features=3072, bias=True)\n"," (fc2): Linear(in_features=3072, out_features=768, bias=True)\n"," )\n"," (layer_norm2): LayerNorm((768,), eps=1e-05, elementwise_affine=True)\n"," )\n"," )\n"," )\n"," (post_layernorm): LayerNorm((768,), eps=1e-05, elementwise_affine=True)\n"," )\n"," (visual_projection): Linear(in_features=768, out_features=512, bias=False)\n"," (text_projection): Linear(in_features=512, out_features=512, bias=False)\n",")"]},"metadata":{},"execution_count":5}]},{"cell_type":"code","source":["# -------------------- Load and Prepare Dataset --------------------\n","# Load CSV with pipe separator and strip columns\n","df = pd.read_csv(CSV_PATH, sep='|', engine='python', skip_blank_lines=True)\n","\n","# Clean column names and strip spaces from text columns\n","df.columns = [col.strip() for col in df.columns]\n","df['image_name'] = df['image_name'].astype(str).str.strip()\n","df['comment'] = df['comment'].astype(str).str.strip()\n","df['comment_number'] = df['comment_number'].astype(str).str.strip()\n","\n","# Function to safely parse comment_number integer from messy strings\n","def parse_comment_number(x):\n"," try:\n"," # Just take the first token and convert to int\n"," return int(x.split()[0])\n"," except:\n"," return -1 # invalid values become -1\n","\n","df['comment_number'] = df['comment_number'].apply(parse_comment_number)\n","\n","# Keep only rows where comment_number == 0 (first comment per image)\n","df = df[df['comment_number'] == 0]\n","\n","# Add full image file path\n","df['filepath'] = df['image_name'].apply(lambda x: os.path.join(IMG_DIR, x))\n","\n","# Filter only rows where image file exists\n","df = df[df['filepath'].apply(os.path.exists)]\n","\n","# Drop duplicate images just in case\n","df = df.drop_duplicates(subset='image_name')\n","\n","# Sample N images or all if less than N\n","df = df.sample(n=min(NUM_IMAGES, len(df)), random_state=42).reset_index(drop=True)\n","\n","# Final lists\n","image_paths = df['filepath'].tolist()\n","captions = df['comment'].tolist()\n","\n","print(f\"Prepared {len(image_paths)} images and captions.\")"],"metadata":{"id":"cxU0DZpNFD4d","colab":{"base_uri":"https://localhost:8080/"},"executionInfo":{"status":"ok","timestamp":1748779630650,"user_tz":-300,"elapsed":12316,"user":{"displayName":"Ramzan0001","userId":"17484931948124609414"}},"outputId":"e3a3afb7-8249-499e-bb85-ca5685b77c3f"},"execution_count":null,"outputs":[{"output_type":"stream","name":"stderr","text":["<ipython-input-6-1d4be4547aa4>:25: SettingWithCopyWarning: \n","A value is trying to be set on a copy of a slice from a DataFrame.\n","Try using .loc[row_indexer,col_indexer] = value instead\n","\n","See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n"," df['filepath'] = df['image_name'].apply(lambda x: os.path.join(IMG_DIR, x))\n"]},{"output_type":"stream","name":"stdout","text":["Prepared 1000 images and captions.\n"]}]},{"cell_type":"code","source":["# -------------------- Precompute Embeddings --------------------\n","image_embeddings = []\n","text_embeddings = []\n","\n","print(\"Computing embeddings...\")\n","\n","with torch.no_grad():\n"," for i in tqdm(range(0, len(image_paths), 16)):\n"," batch_imgs = [Image.open(p).convert(\"RGB\") for p in image_paths[i:i+16]]\n"," batch_texts = captions[i:i+16]\n"," inputs = processor(text=batch_texts, images=batch_imgs, return_tensors=\"pt\", padding=True, truncation=True).to(device)\n"," outputs = model(**inputs)\n"," img_embed = torch.nn.functional.normalize(outputs.image_embeds, p=2, dim=1)\n"," txt_embed = torch.nn.functional.normalize(outputs.text_embeds, p=2, dim=1)\n"," image_embeddings.append(img_embed.cpu())\n"," text_embeddings.append(txt_embed.cpu())\n","\n","image_embeddings = torch.cat(image_embeddings)\n","text_embeddings = torch.cat(text_embeddings)\n","\n","print(\"Embeddings ready!\")"],"metadata":{"id":"I8t5_dEoFG_s","colab":{"base_uri":"https://localhost:8080/"},"executionInfo":{"status":"ok","timestamp":1748711935283,"user_tz":-300,"elapsed":490414,"user":{"displayName":"Ramzan0001","userId":"17484931948124609414"}},"outputId":"e71a8277-a7ec-420f-c185-cb801307cb7f"},"execution_count":null,"outputs":[{"metadata":{"tags":null},"name":"stdout","output_type":"stream","text":["Computing embeddings...\n"]},{"output_type":"stream","name":"stderr","text":["100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 63/63 [09:07<00:00, 8.70s/it]"]},{"output_type":"stream","name":"stdout","text":["Embeddings ready!\n"]},{"output_type":"stream","name":"stderr","text":["\n"]}]},{"cell_type":"code","source":["# Saving Embedding\n","torch.save(image_embeddings, '/content/drive/My Drive/CLIP_Project/Data/Image_Embeddings.pt')\n","torch.save(text_embeddings, '/content/drive/My Drive/CLIP_Project/Data/Text_Embeddings.pt')"],"metadata":{"id":"4SDhqWeTVMrk"},"execution_count":null,"outputs":[]},{"cell_type":"code","source":["# Load embeddings without recomputing:\n","image_embeddings = torch.load('/content/drive/My Drive/CLIP_Project/Data/Image_Embeddings.pt')\n","text_embeddings = torch.load('/content/drive/My Drive/CLIP_Project/Data/Text_Embeddings.pt')"],"metadata":{"id":"dpqQWBU4WG81"},"execution_count":null,"outputs":[]},{"cell_type":"code","source":["# -------------------- Retrieval Functions --------------------\n","\n","def image_to_text(img):\n"," with torch.no_grad():\n"," inputs = processor(images=img, return_tensors=\"pt\").to(device)\n"," query_embed = model.get_image_features(**inputs)\n"," query_embed = torch.nn.functional.normalize(query_embed, p=2, dim=1).cpu()\n"," similarities = (query_embed @ text_embeddings.T).squeeze()\n"," best_idx = similarities.argmax().item()\n"," return captions[best_idx]\n","\n","def text_to_image(text):\n"," with torch.no_grad():\n"," inputs = processor(text=text, return_tensors=\"pt\", padding=True, truncation=True).to(device)\n"," query_embed = model.get_text_features(**inputs)\n"," query_embed = torch.nn.functional.normalize(query_embed, p=2, dim=1).cpu()\n"," similarities = (query_embed @ image_embeddings.T).squeeze()\n"," best_idx = similarities.argmax().item()\n"," return image_paths[best_idx]"],"metadata":{"id":"2khkfWuTFNnd"},"execution_count":null,"outputs":[]},{"cell_type":"code","source":["# -------------------- Gradio Interface --------------------\n","\n","from PIL import Image\n","\n","image_input = gr.Image(type=\"pil\", label=\"Upload an Image\")\n","text_input = gr.Textbox(label=\"Enter Caption\")\n","\n","# Interface for Image β†’ Text\n","iface_img2txt = gr.Interface(\n"," fn=image_to_text,\n"," inputs=image_input,\n"," outputs=gr.Textbox(label=\"Matched Caption\"),\n"," title=\"Image to Text Retrieval\"\n",")\n","\n","# Interface for Text β†’ Image\n","def text_to_image_output(text):\n"," img_path = text_to_image(text)\n"," return Image.open(img_path)\n","\n","iface_txt2img = gr.Interface(\n"," fn=text_to_image_output,\n"," inputs=text_input,\n"," outputs=gr.Image(label=\"Matched Image\"),\n"," title=\"Text to Image Retrieval\"\n",")\n","\n","# Combine both interfaces in tabs\n","interface = gr.TabbedInterface(\n"," [iface_img2txt, iface_txt2img],\n"," [\"Image to Text\", \"Text to Image\"]\n",")"],"metadata":{"id":"If-a-ItzFTuU"},"execution_count":null,"outputs":[]},{"cell_type":"code","source":["interface.launch()"],"metadata":{"id":"q65zsryoFVP_","colab":{"base_uri":"https://localhost:8080/","height":650},"executionInfo":{"status":"ok","timestamp":1748779651545,"user_tz":-300,"elapsed":3428,"user":{"displayName":"Ramzan0001","userId":"17484931948124609414"}},"outputId":"85330b6f-7c68-4314-ee10-1a802334c47e"},"execution_count":null,"outputs":[{"output_type":"stream","name":"stdout","text":["It looks like you are running Gradio on a hosted a Jupyter notebook. For the Gradio app to work, sharing must be enabled. Automatically setting `share=True` (you can turn this off by setting `share=False` in `launch()` explicitly).\n","\n","Colab notebook detected. To show errors in colab notebook, set debug=True in launch()\n","* Running on public URL: https://aa1ce5e21a61c1ae5f.gradio.live\n","\n","This share link expires in 1 week. For free permanent hosting and GPU upgrades, run `gradio deploy` from the terminal in the working directory to deploy to Hugging Face Spaces (https://huggingface.co/spaces)\n"]},{"output_type":"display_data","data":{"text/plain":["<IPython.core.display.HTML object>"],"text/html":["<div><iframe src=\"https://aa1ce5e21a61c1ae5f.gradio.live\" width=\"100%\" height=\"500\" allow=\"autoplay; camera; microphone; clipboard-read; clipboard-write;\" frameborder=\"0\" allowfullscreen></iframe></div>"]},"metadata":{}},{"output_type":"execute_result","data":{"text/plain":[]},"metadata":{},"execution_count":10}]},{"cell_type":"code","source":[],"metadata":{"id":"saaXb_VKVU_1"},"execution_count":null,"outputs":[]}]}
Model_FineTuning.ipynb ADDED
@@ -0,0 +1 @@
 
 
1
+ {"nbformat":4,"nbformat_minor":0,"metadata":{"colab":{"provenance":[],"gpuType":"T4","authorship_tag":"ABX9TyNJyEByrqNazSWXRKS1Vgru"},"kernelspec":{"name":"python3","display_name":"Python 3"},"language_info":{"name":"python"},"accelerator":"GPU","widgets":{"application/vnd.jupyter.widget-state+json":{"daaa8c18609c4e5692bb2f3d5c2dd39e":{"model_module":"@jupyter-widgets/controls","model_name":"HBoxModel","model_module_version":"1.5.0","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"HBoxModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"1.5.0","_view_name":"HBoxView","box_style":"","children":["IPY_MODEL_c76e597ac7404afbaf2cc27943a11ea7","IPY_MODEL_e7164e23d85c4149a66035ffc3977d0e","IPY_MODEL_7e20ed768f404d1bba0a0cda7266ff36"],"layout":"IPY_MODEL_1ead78f36fff432f9d966b602a91d483"}},"c76e597ac7404afbaf2cc27943a11ea7":{"model_module":"@jupyter-widgets/controls","model_name":"HTMLModel","model_module_version":"1.5.0","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_55b124d0eee845f3bd3d41d6350fdff0","placeholder":"​","style":"IPY_MODEL_71330ecf507541d58f776bac0d6427a9","value":"config.json: 100%"}},"e7164e23d85c4149a66035ffc3977d0e":{"model_module":"@jupyter-widgets/controls","model_name":"FloatProgressModel","model_module_version":"1.5.0","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"FloatProgressModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"1.5.0","_view_name":"ProgressView","bar_style":"success","description":"","description_tooltip":null,"layout":"IPY_MODEL_0bd36fadc9f046908cf8e12efb9ee7af","max":4186,"min":0,"orientation":"horizontal","style":"IPY_MODEL_ffec20549c234c35877a623c04cb2727","value":4186}},"7e20ed768f404d1bba0a0cda7266ff36":{"model_module":"@jupyter-widgets/controls","model_name":"HTMLModel","model_module_version":"1.5.0","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_5bedb06d00db4c11822cccf6a37bbd68","placeholder":"​","style":"IPY_MODEL_2d001a21e5b3439d8ec2f7ebcb34a734","value":" 4.19k/4.19k [00:00&lt;00:00, 373kB/s]"}},"1ead78f36fff432f9d966b602a91d483":{"model_module":"@jupyter-widgets/base","model_name":"LayoutModel","model_module_version":"1.2.0","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}},"55b124d0eee845f3bd3d41d6350fdff0":{"model_module":"@jupyter-widgets/base","model_name":"LayoutModel","model_module_version":"1.2.0","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}},"71330ecf507541d58f776bac0d6427a9":{"model_module":"@jupyter-widgets/controls","model_name":"DescriptionStyleModel","model_module_version":"1.5.0","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":""}},"0bd36fadc9f046908cf8e12efb9ee7af":{"model_module":"@jupyter-widgets/base","model_name":"LayoutModel","model_module_version":"1.2.0","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}},"ffec20549c234c35877a623c04cb2727":{"model_module":"@jupyter-widgets/controls","model_name":"ProgressStyleModel","model_module_version":"1.5.0","state":{"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"ProgressStyleModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"StyleView","bar_color":null,"description_width":""}},"5bedb06d00db4c11822cccf6a37bbd68":{"model_module":"@jupyter-widgets/base","model_name":"LayoutModel","model_module_version":"1.2.0","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}},"2d001a21e5b3439d8ec2f7ebcb34a734":{"model_module":"@jupyter-widgets/controls","model_name":"DescriptionStyleModel","model_module_version":"1.5.0","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":""}},"1a8cecaf71714cd9a7d589d8f68c545b":{"model_module":"@jupyter-widgets/controls","model_name":"HBoxModel","model_module_version":"1.5.0","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"HBoxModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"1.5.0","_view_name":"HBoxView","box_style":"","children":["IPY_MODEL_02ee62ab49254a8f873ef2b852e9ad3e","IPY_MODEL_16b503e8aaa6451d92fed764c0e07e6a","IPY_MODEL_a7e12e5fd7a14ad19a0cabe12ea84946"],"layout":"IPY_MODEL_807a4f7ce46a46f0956232391f0928e5"}},"02ee62ab49254a8f873ef2b852e9ad3e":{"model_module":"@jupyter-widgets/controls","model_name":"HTMLModel","model_module_version":"1.5.0","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_327ef716ce1e4535bb7208eb7763702f","placeholder":"​","style":"IPY_MODEL_6cc3086d103d4da3943bbae1aae31863","value":"pytorch_model.bin: 100%"}},"16b503e8aaa6451d92fed764c0e07e6a":{"model_module":"@jupyter-widgets/controls","model_name":"FloatProgressModel","model_module_version":"1.5.0","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"FloatProgressModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"1.5.0","_view_name":"ProgressView","bar_style":"success","description":"","description_tooltip":null,"layout":"IPY_MODEL_8defe1c117f64c5a8e923cdcc9bbe484","max":605247071,"min":0,"orientation":"horizontal","style":"IPY_MODEL_c4b1d5c796e44059a0bea782b48f175e","value":605247071}},"a7e12e5fd7a14ad19a0cabe12ea84946":{"model_module":"@jupyter-widgets/controls","model_name":"HTMLModel","model_module_version":"1.5.0","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_8ee67427c71b41a98fa36bb33f7255d6","placeholder":"​","style":"IPY_MODEL_ebc6eeeed44741ab9317f4294fd67f55","value":" 605M/605M [00:02&lt;00:00, 234MB/s]"}},"807a4f7ce46a46f0956232391f0928e5":{"model_module":"@jupyter-widgets/base","model_name":"LayoutModel","model_module_version":"1.2.0","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}},"327ef716ce1e4535bb7208eb7763702f":{"model_module":"@jupyter-widgets/base","model_name":"LayoutModel","model_module_version":"1.2.0","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}},"6cc3086d103d4da3943bbae1aae31863":{"model_module":"@jupyter-widgets/controls","model_name":"DescriptionStyleModel","model_module_version":"1.5.0","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":""}},"8defe1c117f64c5a8e923cdcc9bbe484":{"model_module":"@jupyter-widgets/base","model_name":"LayoutModel","model_module_version":"1.2.0","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}},"c4b1d5c796e44059a0bea782b48f175e":{"model_module":"@jupyter-widgets/controls","model_name":"ProgressStyleModel","model_module_version":"1.5.0","state":{"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"ProgressStyleModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"StyleView","bar_color":null,"description_width":""}},"8ee67427c71b41a98fa36bb33f7255d6":{"model_module":"@jupyter-widgets/base","model_name":"LayoutModel","model_module_version":"1.2.0","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}},"ebc6eeeed44741ab9317f4294fd67f55":{"model_module":"@jupyter-widgets/controls","model_name":"DescriptionStyleModel","model_module_version":"1.5.0","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":""}},"9434871c66b74ff2bd367ec82bca3da6":{"model_module":"@jupyter-widgets/controls","model_name":"HBoxModel","model_module_version":"1.5.0","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"HBoxModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"1.5.0","_view_name":"HBoxView","box_style":"","children":["IPY_MODEL_94967fa2f310488c8b50b113a75a0e5d","IPY_MODEL_392b2cc806b6444c97360bdb5d903d7c","IPY_MODEL_6e33a52fc2624b1dbfc646e1aacb5de6"],"layout":"IPY_MODEL_28ae51f90af84ecf86f854d56d2db531"}},"94967fa2f310488c8b50b113a75a0e5d":{"model_module":"@jupyter-widgets/controls","model_name":"HTMLModel","model_module_version":"1.5.0","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_5f60eea8bde148ec9271735eadf7e1e8","placeholder":"​","style":"IPY_MODEL_4b4ad12130694011a55c2a36e280b2b4","value":"model.safetensors: 100%"}},"392b2cc806b6444c97360bdb5d903d7c":{"model_module":"@jupyter-widgets/controls","model_name":"FloatProgressModel","model_module_version":"1.5.0","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"FloatProgressModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"1.5.0","_view_name":"ProgressView","bar_style":"success","description":"","description_tooltip":null,"layout":"IPY_MODEL_dfa6825737be401cb6eed473c7cf0b51","max":605157884,"min":0,"orientation":"horizontal","style":"IPY_MODEL_eb8fc9194f1f49c7afc9b78f89724c51","value":605157884}},"6e33a52fc2624b1dbfc646e1aacb5de6":{"model_module":"@jupyter-widgets/controls","model_name":"HTMLModel","model_module_version":"1.5.0","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_82cf97a023864fccae1c62bbff7d555f","placeholder":"​","style":"IPY_MODEL_484d81f2c42d449990cb8a291e939f4b","value":" 605M/605M [00:04&lt;00:00, 172MB/s]"}},"28ae51f90af84ecf86f854d56d2db531":{"model_module":"@jupyter-widgets/base","model_name":"LayoutModel","model_module_version":"1.2.0","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}},"5f60eea8bde148ec9271735eadf7e1e8":{"model_module":"@jupyter-widgets/base","model_name":"LayoutModel","model_module_version":"1.2.0","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}},"4b4ad12130694011a55c2a36e280b2b4":{"model_module":"@jupyter-widgets/controls","model_name":"DescriptionStyleModel","model_module_version":"1.5.0","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":""}},"dfa6825737be401cb6eed473c7cf0b51":{"model_module":"@jupyter-widgets/base","model_name":"LayoutModel","model_module_version":"1.2.0","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}},"eb8fc9194f1f49c7afc9b78f89724c51":{"model_module":"@jupyter-widgets/controls","model_name":"ProgressStyleModel","model_module_version":"1.5.0","state":{"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"ProgressStyleModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"StyleView","bar_color":null,"description_width":""}},"82cf97a023864fccae1c62bbff7d555f":{"model_module":"@jupyter-widgets/base","model_name":"LayoutModel","model_module_version":"1.2.0","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}},"484d81f2c42d449990cb8a291e939f4b":{"model_module":"@jupyter-widgets/controls","model_name":"DescriptionStyleModel","model_module_version":"1.5.0","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":""}},"d95d175315cb4ffcad7e6dab55425ce8":{"model_module":"@jupyter-widgets/controls","model_name":"HBoxModel","model_module_version":"1.5.0","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"HBoxModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"1.5.0","_view_name":"HBoxView","box_style":"","children":["IPY_MODEL_ba81066de60c43a9b0b63c703264ff16","IPY_MODEL_c8687f02e4544a9a8e3e7a507bcea544","IPY_MODEL_4d2923e5213d4361acde79185b04433a"],"layout":"IPY_MODEL_031bdce6b2314500977a95d1b1f31dcb"}},"ba81066de60c43a9b0b63c703264ff16":{"model_module":"@jupyter-widgets/controls","model_name":"HTMLModel","model_module_version":"1.5.0","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_b9287af72c884bc7a0823d1b35da7db5","placeholder":"​","style":"IPY_MODEL_958140ee381041d0820a16598590ae60","value":"preprocessor_config.json: 100%"}},"c8687f02e4544a9a8e3e7a507bcea544":{"model_module":"@jupyter-widgets/controls","model_name":"FloatProgressModel","model_module_version":"1.5.0","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"FloatProgressModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"1.5.0","_view_name":"ProgressView","bar_style":"success","description":"","description_tooltip":null,"layout":"IPY_MODEL_a64ab080e5d5456a8584313465bbef4c","max":316,"min":0,"orientation":"horizontal","style":"IPY_MODEL_5b0a166da3ee44499109781a15388917","value":316}},"4d2923e5213d4361acde79185b04433a":{"model_module":"@jupyter-widgets/controls","model_name":"HTMLModel","model_module_version":"1.5.0","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_87be267c5e8a443db7ecff6a841b1469","placeholder":"​","style":"IPY_MODEL_bcbc2405a41e4bb79e925055ea60779d","value":" 316/316 [00:00&lt;00:00, 30.7kB/s]"}},"031bdce6b2314500977a95d1b1f31dcb":{"model_module":"@jupyter-widgets/base","model_name":"LayoutModel","model_module_version":"1.2.0","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}},"b9287af72c884bc7a0823d1b35da7db5":{"model_module":"@jupyter-widgets/base","model_name":"LayoutModel","model_module_version":"1.2.0","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}},"958140ee381041d0820a16598590ae60":{"model_module":"@jupyter-widgets/controls","model_name":"DescriptionStyleModel","model_module_version":"1.5.0","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":""}},"a64ab080e5d5456a8584313465bbef4c":{"model_module":"@jupyter-widgets/base","model_name":"LayoutModel","model_module_version":"1.2.0","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}},"5b0a166da3ee44499109781a15388917":{"model_module":"@jupyter-widgets/controls","model_name":"ProgressStyleModel","model_module_version":"1.5.0","state":{"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"ProgressStyleModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"StyleView","bar_color":null,"description_width":""}},"87be267c5e8a443db7ecff6a841b1469":{"model_module":"@jupyter-widgets/base","model_name":"LayoutModel","model_module_version":"1.2.0","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}},"bcbc2405a41e4bb79e925055ea60779d":{"model_module":"@jupyter-widgets/controls","model_name":"DescriptionStyleModel","model_module_version":"1.5.0","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":""}},"c69405bf499a4f53b5a8e35420f2d5a9":{"model_module":"@jupyter-widgets/controls","model_name":"HBoxModel","model_module_version":"1.5.0","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"HBoxModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"1.5.0","_view_name":"HBoxView","box_style":"","children":["IPY_MODEL_6288708a768d4b45aed5be2bdea4e4ad","IPY_MODEL_9adb2d05d30a4da1a5d60ff307913f38","IPY_MODEL_9f3d1db93ed647f6a4dcaf9b5f73200d"],"layout":"IPY_MODEL_992b16f5d6434c3fa129deb2d2c27440"}},"6288708a768d4b45aed5be2bdea4e4ad":{"model_module":"@jupyter-widgets/controls","model_name":"HTMLModel","model_module_version":"1.5.0","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_27c363b960454eabb99f3810403c9453","placeholder":"​","style":"IPY_MODEL_39ff1f6ecdf74ed7849c59f9af1a6052","value":"tokenizer_config.json: 100%"}},"9adb2d05d30a4da1a5d60ff307913f38":{"model_module":"@jupyter-widgets/controls","model_name":"FloatProgressModel","model_module_version":"1.5.0","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"FloatProgressModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"1.5.0","_view_name":"ProgressView","bar_style":"success","description":"","description_tooltip":null,"layout":"IPY_MODEL_968b486c482249c090da3d6b91a00840","max":592,"min":0,"orientation":"horizontal","style":"IPY_MODEL_197d3a50b2ef4931977841f18c50e618","value":592}},"9f3d1db93ed647f6a4dcaf9b5f73200d":{"model_module":"@jupyter-widgets/controls","model_name":"HTMLModel","model_module_version":"1.5.0","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_513a5bb595a6456c8ffd90fde728a7f5","placeholder":"​","style":"IPY_MODEL_0a3444b0306241b2a00a81e53c9ebc25","value":" 592/592 [00:00&lt;00:00, 21.2kB/s]"}},"992b16f5d6434c3fa129deb2d2c27440":{"model_module":"@jupyter-widgets/base","model_name":"LayoutModel","model_module_version":"1.2.0","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}},"27c363b960454eabb99f3810403c9453":{"model_module":"@jupyter-widgets/base","model_name":"LayoutModel","model_module_version":"1.2.0","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}},"39ff1f6ecdf74ed7849c59f9af1a6052":{"model_module":"@jupyter-widgets/controls","model_name":"DescriptionStyleModel","model_module_version":"1.5.0","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":""}},"968b486c482249c090da3d6b91a00840":{"model_module":"@jupyter-widgets/base","model_name":"LayoutModel","model_module_version":"1.2.0","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}},"197d3a50b2ef4931977841f18c50e618":{"model_module":"@jupyter-widgets/controls","model_name":"ProgressStyleModel","model_module_version":"1.5.0","state":{"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"ProgressStyleModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"StyleView","bar_color":null,"description_width":""}},"513a5bb595a6456c8ffd90fde728a7f5":{"model_module":"@jupyter-widgets/base","model_name":"LayoutModel","model_module_version":"1.2.0","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}},"0a3444b0306241b2a00a81e53c9ebc25":{"model_module":"@jupyter-widgets/controls","model_name":"DescriptionStyleModel","model_module_version":"1.5.0","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":""}},"8e30fb57ffcc4d38904e5f6665b514b3":{"model_module":"@jupyter-widgets/controls","model_name":"HBoxModel","model_module_version":"1.5.0","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"HBoxModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"1.5.0","_view_name":"HBoxView","box_style":"","children":["IPY_MODEL_afc5c50f187d4a0eacf3c7300fb98bcb","IPY_MODEL_addcb46423534905887e8887ae548b20","IPY_MODEL_7538a6f88ce94f2da30fc090fc57d22d"],"layout":"IPY_MODEL_e54e2cc91b3e4502baf49051cfc5bc7f"}},"afc5c50f187d4a0eacf3c7300fb98bcb":{"model_module":"@jupyter-widgets/controls","model_name":"HTMLModel","model_module_version":"1.5.0","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_3ebd9c0f52a54db195916b5d5e0db07a","placeholder":"​","style":"IPY_MODEL_0425f1fe3a74453fb39457b63e456f8b","value":"vocab.json: 100%"}},"addcb46423534905887e8887ae548b20":{"model_module":"@jupyter-widgets/controls","model_name":"FloatProgressModel","model_module_version":"1.5.0","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"FloatProgressModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"1.5.0","_view_name":"ProgressView","bar_style":"success","description":"","description_tooltip":null,"layout":"IPY_MODEL_726e39ae350845509386c0c362626205","max":862328,"min":0,"orientation":"horizontal","style":"IPY_MODEL_37306dbd88774d5da5f615520b71500a","value":862328}},"7538a6f88ce94f2da30fc090fc57d22d":{"model_module":"@jupyter-widgets/controls","model_name":"HTMLModel","model_module_version":"1.5.0","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_2ccf4d992e2242c48d9425d8c0c4dab1","placeholder":"​","style":"IPY_MODEL_9c0f9a54144d4153977d632448ae5f7b","value":" 862k/862k [00:00&lt;00:00, 6.14MB/s]"}},"e54e2cc91b3e4502baf49051cfc5bc7f":{"model_module":"@jupyter-widgets/base","model_name":"LayoutModel","model_module_version":"1.2.0","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}},"3ebd9c0f52a54db195916b5d5e0db07a":{"model_module":"@jupyter-widgets/base","model_name":"LayoutModel","model_module_version":"1.2.0","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}},"0425f1fe3a74453fb39457b63e456f8b":{"model_module":"@jupyter-widgets/controls","model_name":"DescriptionStyleModel","model_module_version":"1.5.0","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":""}},"726e39ae350845509386c0c362626205":{"model_module":"@jupyter-widgets/base","model_name":"LayoutModel","model_module_version":"1.2.0","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}},"37306dbd88774d5da5f615520b71500a":{"model_module":"@jupyter-widgets/controls","model_name":"ProgressStyleModel","model_module_version":"1.5.0","state":{"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"ProgressStyleModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"StyleView","bar_color":null,"description_width":""}},"2ccf4d992e2242c48d9425d8c0c4dab1":{"model_module":"@jupyter-widgets/base","model_name":"LayoutModel","model_module_version":"1.2.0","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}},"9c0f9a54144d4153977d632448ae5f7b":{"model_module":"@jupyter-widgets/controls","model_name":"DescriptionStyleModel","model_module_version":"1.5.0","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":""}},"6c9bca981b7d4ddf811b763a0579e0f1":{"model_module":"@jupyter-widgets/controls","model_name":"HBoxModel","model_module_version":"1.5.0","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"HBoxModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"1.5.0","_view_name":"HBoxView","box_style":"","children":["IPY_MODEL_155f6cf9283b4b4d8922f22dbcaf7a51","IPY_MODEL_827c138f60ea42688223e53939e86151","IPY_MODEL_59b19c65009e44598d2071228800575d"],"layout":"IPY_MODEL_f562dfcb15be41c58b305890ed6e210c"}},"155f6cf9283b4b4d8922f22dbcaf7a51":{"model_module":"@jupyter-widgets/controls","model_name":"HTMLModel","model_module_version":"1.5.0","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_222d874fc5394076b0aea93247c5a196","placeholder":"​","style":"IPY_MODEL_708fe3f1ffc944129d441d0bdcb67aaf","value":"merges.txt: 100%"}},"827c138f60ea42688223e53939e86151":{"model_module":"@jupyter-widgets/controls","model_name":"FloatProgressModel","model_module_version":"1.5.0","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"FloatProgressModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"1.5.0","_view_name":"ProgressView","bar_style":"success","description":"","description_tooltip":null,"layout":"IPY_MODEL_8b0014015c4c4b0888cd401ffe9d6530","max":524657,"min":0,"orientation":"horizontal","style":"IPY_MODEL_84bec341a8c040de89e9193d54f8f11c","value":524657}},"59b19c65009e44598d2071228800575d":{"model_module":"@jupyter-widgets/controls","model_name":"HTMLModel","model_module_version":"1.5.0","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_3c2e94e30c364b77a03635efbbea507a","placeholder":"​","style":"IPY_MODEL_b3d1d41d2de14eb4a8d914b59a5a73c7","value":" 525k/525k [00:00&lt;00:00, 7.99MB/s]"}},"f562dfcb15be41c58b305890ed6e210c":{"model_module":"@jupyter-widgets/base","model_name":"LayoutModel","model_module_version":"1.2.0","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}},"222d874fc5394076b0aea93247c5a196":{"model_module":"@jupyter-widgets/base","model_name":"LayoutModel","model_module_version":"1.2.0","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}},"708fe3f1ffc944129d441d0bdcb67aaf":{"model_module":"@jupyter-widgets/controls","model_name":"DescriptionStyleModel","model_module_version":"1.5.0","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":""}},"8b0014015c4c4b0888cd401ffe9d6530":{"model_module":"@jupyter-widgets/base","model_name":"LayoutModel","model_module_version":"1.2.0","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}},"84bec341a8c040de89e9193d54f8f11c":{"model_module":"@jupyter-widgets/controls","model_name":"ProgressStyleModel","model_module_version":"1.5.0","state":{"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"ProgressStyleModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"StyleView","bar_color":null,"description_width":""}},"3c2e94e30c364b77a03635efbbea507a":{"model_module":"@jupyter-widgets/base","model_name":"LayoutModel","model_module_version":"1.2.0","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}},"b3d1d41d2de14eb4a8d914b59a5a73c7":{"model_module":"@jupyter-widgets/controls","model_name":"DescriptionStyleModel","model_module_version":"1.5.0","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":""}},"5ae42e187ce14ec8af1d7c83c670a912":{"model_module":"@jupyter-widgets/controls","model_name":"HBoxModel","model_module_version":"1.5.0","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"HBoxModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"1.5.0","_view_name":"HBoxView","box_style":"","children":["IPY_MODEL_52cf8391eb8f4c57aab6f1858d4220ae","IPY_MODEL_85cc6ff765564e4c878d233d352f8c11","IPY_MODEL_e560064743db4d5eb2c857e4464a222c"],"layout":"IPY_MODEL_e39761510dd24c91adb074d06e29ca22"}},"52cf8391eb8f4c57aab6f1858d4220ae":{"model_module":"@jupyter-widgets/controls","model_name":"HTMLModel","model_module_version":"1.5.0","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_43a045b6b7954f6f8b0501fb4e0fe796","placeholder":"​","style":"IPY_MODEL_203144caba9c473b9a91c59e319c1385","value":"tokenizer.json: 100%"}},"85cc6ff765564e4c878d233d352f8c11":{"model_module":"@jupyter-widgets/controls","model_name":"FloatProgressModel","model_module_version":"1.5.0","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"FloatProgressModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"1.5.0","_view_name":"ProgressView","bar_style":"success","description":"","description_tooltip":null,"layout":"IPY_MODEL_a62d653b89294b8fa45132fc81f5cbed","max":2224041,"min":0,"orientation":"horizontal","style":"IPY_MODEL_a90a71c0f6b1458a8274ab3295d28c84","value":2224041}},"e560064743db4d5eb2c857e4464a222c":{"model_module":"@jupyter-widgets/controls","model_name":"HTMLModel","model_module_version":"1.5.0","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_77c03236e41743989e719a4ca514bae6","placeholder":"​","style":"IPY_MODEL_ccc950674b5c4b7b98fcd8bdafdbffba","value":" 2.22M/2.22M [00:00&lt;00:00, 30.1MB/s]"}},"e39761510dd24c91adb074d06e29ca22":{"model_module":"@jupyter-widgets/base","model_name":"LayoutModel","model_module_version":"1.2.0","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}},"43a045b6b7954f6f8b0501fb4e0fe796":{"model_module":"@jupyter-widgets/base","model_name":"LayoutModel","model_module_version":"1.2.0","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}},"203144caba9c473b9a91c59e319c1385":{"model_module":"@jupyter-widgets/controls","model_name":"DescriptionStyleModel","model_module_version":"1.5.0","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":""}},"a62d653b89294b8fa45132fc81f5cbed":{"model_module":"@jupyter-widgets/base","model_name":"LayoutModel","model_module_version":"1.2.0","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}},"a90a71c0f6b1458a8274ab3295d28c84":{"model_module":"@jupyter-widgets/controls","model_name":"ProgressStyleModel","model_module_version":"1.5.0","state":{"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"ProgressStyleModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"StyleView","bar_color":null,"description_width":""}},"77c03236e41743989e719a4ca514bae6":{"model_module":"@jupyter-widgets/base","model_name":"LayoutModel","model_module_version":"1.2.0","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}},"ccc950674b5c4b7b98fcd8bdafdbffba":{"model_module":"@jupyter-widgets/controls","model_name":"DescriptionStyleModel","model_module_version":"1.5.0","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":""}},"b52a126def7c4e98accef3d3fe88785b":{"model_module":"@jupyter-widgets/controls","model_name":"HBoxModel","model_module_version":"1.5.0","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"HBoxModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"1.5.0","_view_name":"HBoxView","box_style":"","children":["IPY_MODEL_190f1b1b2bbd4b5f8044411951f24e37","IPY_MODEL_92909adcb6494bf5a54e0a4f1316ffbb","IPY_MODEL_88b0028ae8904923b335d19330057ef7"],"layout":"IPY_MODEL_3c966e1dccb34e5f9d3a78fa836d71cf"}},"190f1b1b2bbd4b5f8044411951f24e37":{"model_module":"@jupyter-widgets/controls","model_name":"HTMLModel","model_module_version":"1.5.0","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_9aeae0482b6e4924939fa132c83e2e8a","placeholder":"​","style":"IPY_MODEL_1a05c170478c4bfe8fa0a3573c1df03b","value":"special_tokens_map.json: 100%"}},"92909adcb6494bf5a54e0a4f1316ffbb":{"model_module":"@jupyter-widgets/controls","model_name":"FloatProgressModel","model_module_version":"1.5.0","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"FloatProgressModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"1.5.0","_view_name":"ProgressView","bar_style":"success","description":"","description_tooltip":null,"layout":"IPY_MODEL_8a460b85260943b1bdaeff7f5a10ac8d","max":389,"min":0,"orientation":"horizontal","style":"IPY_MODEL_39849086e1044d44add258ef58587766","value":389}},"88b0028ae8904923b335d19330057ef7":{"model_module":"@jupyter-widgets/controls","model_name":"HTMLModel","model_module_version":"1.5.0","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_33a58409fdb94483b9d8211b6574f2cf","placeholder":"​","style":"IPY_MODEL_2c39c20d8abb4e8da59c1e223f4c2c47","value":" 389/389 [00:00&lt;00:00, 15.1kB/s]"}},"3c966e1dccb34e5f9d3a78fa836d71cf":{"model_module":"@jupyter-widgets/base","model_name":"LayoutModel","model_module_version":"1.2.0","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}},"9aeae0482b6e4924939fa132c83e2e8a":{"model_module":"@jupyter-widgets/base","model_name":"LayoutModel","model_module_version":"1.2.0","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}},"1a05c170478c4bfe8fa0a3573c1df03b":{"model_module":"@jupyter-widgets/controls","model_name":"DescriptionStyleModel","model_module_version":"1.5.0","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":""}},"8a460b85260943b1bdaeff7f5a10ac8d":{"model_module":"@jupyter-widgets/base","model_name":"LayoutModel","model_module_version":"1.2.0","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}},"39849086e1044d44add258ef58587766":{"model_module":"@jupyter-widgets/controls","model_name":"ProgressStyleModel","model_module_version":"1.5.0","state":{"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"ProgressStyleModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"StyleView","bar_color":null,"description_width":""}},"33a58409fdb94483b9d8211b6574f2cf":{"model_module":"@jupyter-widgets/base","model_name":"LayoutModel","model_module_version":"1.2.0","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}},"2c39c20d8abb4e8da59c1e223f4c2c47":{"model_module":"@jupyter-widgets/controls","model_name":"DescriptionStyleModel","model_module_version":"1.5.0","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":""}}}}},"cells":[{"cell_type":"code","execution_count":null,"metadata":{"id":"-Jo7pQUBXo9d","colab":{"base_uri":"https://localhost:8080/"},"outputId":"5029fc34-296a-4ba3-8bbe-2895aaed80ac"},"outputs":[{"metadata":{"tags":null},"name":"stdout","output_type":"stream","text":["\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m54.2/54.2 MB\u001b[0m \u001b[31m14.5 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n","\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m323.3/323.3 kB\u001b[0m \u001b[31m16.6 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n","\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m44.8/44.8 kB\u001b[0m \u001b[31m3.5 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n","\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m363.4/363.4 MB\u001b[0m \u001b[31m4.2 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n","\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m13.8/13.8 MB\u001b[0m \u001b[31m68.5 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n","\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m24.6/24.6 MB\u001b[0m \u001b[31m62.7 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n","\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m883.7/883.7 kB\u001b[0m \u001b[31m42.4 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n","\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m664.8/664.8 MB\u001b[0m \u001b[31m2.5 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n","\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m211.5/211.5 MB\u001b[0m \u001b[31m5.7 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n","\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m56.3/56.3 MB\u001b[0m \u001b[31m10.2 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n","\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m127.9/127.9 MB\u001b[0m \u001b[31m7.2 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n","\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m207.5/207.5 MB\u001b[0m \u001b[31m3.8 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n","\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m21.1/21.1 MB\u001b[0m \u001b[31m30.0 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n","\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m95.2/95.2 kB\u001b[0m \u001b[31m7.0 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n","\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m11.5/11.5 MB\u001b[0m \u001b[31m69.2 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n","\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m72.0/72.0 kB\u001b[0m \u001b[31m4.9 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n","\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m62.5/62.5 kB\u001b[0m \u001b[31m3.9 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n","\u001b[?25h"]}],"source":["!pip install -q transformers datasets gradio ftfy torch torchvision tqdm"]},{"cell_type":"code","source":["from google.colab import drive\n","drive.mount('/content/drive')\n","\n","# Define your model save directory\n","save_path = \"/content/drive/My Drive/CLIP_Project/Model_Files\""],"metadata":{"colab":{"base_uri":"https://localhost:8080/"},"id":"KL33U5DwXv1y","executionInfo":{"status":"ok","timestamp":1748703606748,"user_tz":-300,"elapsed":38276,"user":{"displayName":"Ramzan0001","userId":"17484931948124609414"}},"outputId":"79942def-6472-45cb-a5ff-0cd5cd65aa2a"},"execution_count":2,"outputs":[{"output_type":"stream","name":"stdout","text":["Mounted at /content/drive\n"]}]},{"cell_type":"code","source":["import os\n","import pandas as pd\n","\n","# Paths\n","CSV_PATH = '/content/drive/My Drive/CLIP_Project/Data/results.csv'\n","IMG_DIR = '/content/drive/My Drive/CLIP_Project/Data/Fine_Tuning_Images'\n","\n","# Step 1: Read CSV correctly\n","df = pd.read_csv(CSV_PATH, sep='|', engine='python', skip_blank_lines=True)\n","df.columns = [col.strip() for col in df.columns] # Clean column names\n","\n","# Step 2: Clean up data\n","df['image_name'] = df['image_name'].astype(str).str.strip()\n","df['comment'] = df['comment'].astype(str).str.strip()\n","df['comment_number'] = pd.to_numeric(df['comment_number'], errors='coerce')\n","\n","# Step 3: Filter for first caption per image\n","df = df[df['comment_number'] == 0]\n","\n","# Step 4: Create full file paths and filter only existing images\n","df['filepath'] = df['image_name'].apply(lambda x: os.path.join(IMG_DIR, x))\n","df = df[df['filepath'].apply(os.path.exists)].reset_index(drop=True)\n","\n","# Step 5 (Optional): Limit to 5000 samples max\n","df = df.sample(n=min(5000, len(df)), random_state=42).reset_index(drop=True)\n","\n","# Final check\n","print(f\"Total valid image-caption pairs: {len(df)}\")\n","print(\"Sample Data:\\n\", df.head())"],"metadata":{"colab":{"base_uri":"https://localhost:8080/"},"id":"U_DXo5gkYYkX","executionInfo":{"status":"ok","timestamp":1748703951547,"user_tz":-300,"elapsed":5300,"user":{"displayName":"Ramzan0001","userId":"17484931948124609414"}},"outputId":"5af08e28-36c2-4b25-dbd5-fe294b4614fd"},"execution_count":4,"outputs":[{"output_type":"stream","name":"stderr","text":["<ipython-input-4-73c8d02e31e2>:21: SettingWithCopyWarning: \n","A value is trying to be set on a copy of a slice from a DataFrame.\n","Try using .loc[row_indexer,col_indexer] = value instead\n","\n","See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n"," df['filepath'] = df['image_name'].apply(lambda x: os.path.join(IMG_DIR, x))\n"]},{"output_type":"stream","name":"stdout","text":["Total valid image-caption pairs: 5000\n","Sample Data:\n"," image_name comment_number \\\n","0 223299142.jpg 0.0 \n","1 309687244.jpg 0.0 \n","2 316266025.jpg 0.0 \n","3 185075930.jpg 0.0 \n","4 153963868.jpg 0.0 \n","\n"," comment \\\n","0 The grass has ice on it and there is a mountai... \n","1 A man dressed in gray climbing a large brown r... \n","2 A man wearing a tan sweater is sitting on the ... \n","3 A blond boy smiles with his eyes closed , buri... \n","4 An operator in a gold hard hat and orange vest... \n","\n"," filepath \n","0 /content/drive/My Drive/CLIP_Project/Data/Fine... \n","1 /content/drive/My Drive/CLIP_Project/Data/Fine... \n","2 /content/drive/My Drive/CLIP_Project/Data/Fine... \n","3 /content/drive/My Drive/CLIP_Project/Data/Fine... \n","4 /content/drive/My Drive/CLIP_Project/Data/Fine... \n"]}]},{"cell_type":"code","source":["from PIL import Image\n","from torch.utils.data import Dataset, DataLoader\n","from transformers import CLIPProcessor, CLIPModel\n","import torch"],"metadata":{"id":"s0MXU2FQYeAQ","executionInfo":{"status":"ok","timestamp":1748703996982,"user_tz":-300,"elapsed":33361,"user":{"displayName":"Ramzan0001","userId":"17484931948124609414"}}},"execution_count":5,"outputs":[]},{"cell_type":"code","source":["device = \"cuda\" if torch.cuda.is_available() else \"cpu\""],"metadata":{"id":"H3egvczAYCmm","executionInfo":{"status":"ok","timestamp":1748704006767,"user_tz":-300,"elapsed":38,"user":{"displayName":"Ramzan0001","userId":"17484931948124609414"}}},"execution_count":6,"outputs":[]},{"cell_type":"code","source":["model = CLIPModel.from_pretrained(\"openai/clip-vit-base-patch32\").to(device)\n","processor = CLIPProcessor.from_pretrained(\"openai/clip-vit-base-patch32\")"],"metadata":{"id":"qrXgy1RAYyaQ","colab":{"base_uri":"https://localhost:8080/","height":453,"referenced_widgets":["daaa8c18609c4e5692bb2f3d5c2dd39e","c76e597ac7404afbaf2cc27943a11ea7","e7164e23d85c4149a66035ffc3977d0e","7e20ed768f404d1bba0a0cda7266ff36","1ead78f36fff432f9d966b602a91d483","55b124d0eee845f3bd3d41d6350fdff0","71330ecf507541d58f776bac0d6427a9","0bd36fadc9f046908cf8e12efb9ee7af","ffec20549c234c35877a623c04cb2727","5bedb06d00db4c11822cccf6a37bbd68","2d001a21e5b3439d8ec2f7ebcb34a734","1a8cecaf71714cd9a7d589d8f68c545b","02ee62ab49254a8f873ef2b852e9ad3e","16b503e8aaa6451d92fed764c0e07e6a","a7e12e5fd7a14ad19a0cabe12ea84946","807a4f7ce46a46f0956232391f0928e5","327ef716ce1e4535bb7208eb7763702f","6cc3086d103d4da3943bbae1aae31863","8defe1c117f64c5a8e923cdcc9bbe484","c4b1d5c796e44059a0bea782b48f175e","8ee67427c71b41a98fa36bb33f7255d6","ebc6eeeed44741ab9317f4294fd67f55","9434871c66b74ff2bd367ec82bca3da6","94967fa2f310488c8b50b113a75a0e5d","392b2cc806b6444c97360bdb5d903d7c","6e33a52fc2624b1dbfc646e1aacb5de6","28ae51f90af84ecf86f854d56d2db531","5f60eea8bde148ec9271735eadf7e1e8","4b4ad12130694011a55c2a36e280b2b4","dfa6825737be401cb6eed473c7cf0b51","eb8fc9194f1f49c7afc9b78f89724c51","82cf97a023864fccae1c62bbff7d555f","484d81f2c42d449990cb8a291e939f4b","d95d175315cb4ffcad7e6dab55425ce8","ba81066de60c43a9b0b63c703264ff16","c8687f02e4544a9a8e3e7a507bcea544","4d2923e5213d4361acde79185b04433a","031bdce6b2314500977a95d1b1f31dcb","b9287af72c884bc7a0823d1b35da7db5","958140ee381041d0820a16598590ae60","a64ab080e5d5456a8584313465bbef4c","5b0a166da3ee44499109781a15388917","87be267c5e8a443db7ecff6a841b1469","bcbc2405a41e4bb79e925055ea60779d","c69405bf499a4f53b5a8e35420f2d5a9","6288708a768d4b45aed5be2bdea4e4ad","9adb2d05d30a4da1a5d60ff307913f38","9f3d1db93ed647f6a4dcaf9b5f73200d","992b16f5d6434c3fa129deb2d2c27440","27c363b960454eabb99f3810403c9453","39ff1f6ecdf74ed7849c59f9af1a6052","968b486c482249c090da3d6b91a00840","197d3a50b2ef4931977841f18c50e618","513a5bb595a6456c8ffd90fde728a7f5","0a3444b0306241b2a00a81e53c9ebc25","8e30fb57ffcc4d38904e5f6665b514b3","afc5c50f187d4a0eacf3c7300fb98bcb","addcb46423534905887e8887ae548b20","7538a6f88ce94f2da30fc090fc57d22d","e54e2cc91b3e4502baf49051cfc5bc7f","3ebd9c0f52a54db195916b5d5e0db07a","0425f1fe3a74453fb39457b63e456f8b","726e39ae350845509386c0c362626205","37306dbd88774d5da5f615520b71500a","2ccf4d992e2242c48d9425d8c0c4dab1","9c0f9a54144d4153977d632448ae5f7b","6c9bca981b7d4ddf811b763a0579e0f1","155f6cf9283b4b4d8922f22dbcaf7a51","827c138f60ea42688223e53939e86151","59b19c65009e44598d2071228800575d","f562dfcb15be41c58b305890ed6e210c","222d874fc5394076b0aea93247c5a196","708fe3f1ffc944129d441d0bdcb67aaf","8b0014015c4c4b0888cd401ffe9d6530","84bec341a8c040de89e9193d54f8f11c","3c2e94e30c364b77a03635efbbea507a","b3d1d41d2de14eb4a8d914b59a5a73c7","5ae42e187ce14ec8af1d7c83c670a912","52cf8391eb8f4c57aab6f1858d4220ae","85cc6ff765564e4c878d233d352f8c11","e560064743db4d5eb2c857e4464a222c","e39761510dd24c91adb074d06e29ca22","43a045b6b7954f6f8b0501fb4e0fe796","203144caba9c473b9a91c59e319c1385","a62d653b89294b8fa45132fc81f5cbed","a90a71c0f6b1458a8274ab3295d28c84","77c03236e41743989e719a4ca514bae6","ccc950674b5c4b7b98fcd8bdafdbffba","b52a126def7c4e98accef3d3fe88785b","190f1b1b2bbd4b5f8044411951f24e37","92909adcb6494bf5a54e0a4f1316ffbb","88b0028ae8904923b335d19330057ef7","3c966e1dccb34e5f9d3a78fa836d71cf","9aeae0482b6e4924939fa132c83e2e8a","1a05c170478c4bfe8fa0a3573c1df03b","8a460b85260943b1bdaeff7f5a10ac8d","39849086e1044d44add258ef58587766","33a58409fdb94483b9d8211b6574f2cf","2c39c20d8abb4e8da59c1e223f4c2c47"]},"executionInfo":{"status":"ok","timestamp":1748704019065,"user_tz":-300,"elapsed":10268,"user":{"displayName":"Ramzan0001","userId":"17484931948124609414"}},"outputId":"f9301b2b-0dbb-4a28-f8a1-29d49e6cd03e"},"execution_count":7,"outputs":[{"output_type":"stream","name":"stderr","text":["/usr/local/lib/python3.11/dist-packages/huggingface_hub/utils/_auth.py:94: UserWarning: \n","The secret `HF_TOKEN` does not exist in your Colab secrets.\n","To authenticate with the Hugging Face Hub, create a token in your settings tab (https://huggingface.co/settings/tokens), set it as secret in your Google Colab and restart your session.\n","You will be able to reuse this secret in all of your notebooks.\n","Please note that authentication is recommended but still optional to access public models or datasets.\n"," warnings.warn(\n"]},{"output_type":"display_data","data":{"text/plain":["config.json: 0%| | 0.00/4.19k [00:00<?, ?B/s]"],"application/vnd.jupyter.widget-view+json":{"version_major":2,"version_minor":0,"model_id":"daaa8c18609c4e5692bb2f3d5c2dd39e"}},"metadata":{}},{"output_type":"display_data","data":{"text/plain":["pytorch_model.bin: 0%| | 0.00/605M [00:00<?, ?B/s]"],"application/vnd.jupyter.widget-view+json":{"version_major":2,"version_minor":0,"model_id":"1a8cecaf71714cd9a7d589d8f68c545b"}},"metadata":{}},{"output_type":"display_data","data":{"text/plain":["model.safetensors: 0%| | 0.00/605M [00:00<?, ?B/s]"],"application/vnd.jupyter.widget-view+json":{"version_major":2,"version_minor":0,"model_id":"9434871c66b74ff2bd367ec82bca3da6"}},"metadata":{}},{"output_type":"stream","name":"stderr","text":["Using a slow image processor as `use_fast` is unset and a slow processor was saved with this model. `use_fast=True` will be the default behavior in v4.52, even if the model was saved with a slow processor. This will result in minor differences in outputs. You'll still be able to use a slow processor with `use_fast=False`.\n"]},{"output_type":"display_data","data":{"text/plain":["preprocessor_config.json: 0%| | 0.00/316 [00:00<?, ?B/s]"],"application/vnd.jupyter.widget-view+json":{"version_major":2,"version_minor":0,"model_id":"d95d175315cb4ffcad7e6dab55425ce8"}},"metadata":{}},{"output_type":"display_data","data":{"text/plain":["tokenizer_config.json: 0%| | 0.00/592 [00:00<?, ?B/s]"],"application/vnd.jupyter.widget-view+json":{"version_major":2,"version_minor":0,"model_id":"c69405bf499a4f53b5a8e35420f2d5a9"}},"metadata":{}},{"output_type":"display_data","data":{"text/plain":["vocab.json: 0%| | 0.00/862k [00:00<?, ?B/s]"],"application/vnd.jupyter.widget-view+json":{"version_major":2,"version_minor":0,"model_id":"8e30fb57ffcc4d38904e5f6665b514b3"}},"metadata":{}},{"output_type":"display_data","data":{"text/plain":["merges.txt: 0%| | 0.00/525k [00:00<?, ?B/s]"],"application/vnd.jupyter.widget-view+json":{"version_major":2,"version_minor":0,"model_id":"6c9bca981b7d4ddf811b763a0579e0f1"}},"metadata":{}},{"output_type":"display_data","data":{"text/plain":["tokenizer.json: 0%| | 0.00/2.22M [00:00<?, ?B/s]"],"application/vnd.jupyter.widget-view+json":{"version_major":2,"version_minor":0,"model_id":"5ae42e187ce14ec8af1d7c83c670a912"}},"metadata":{}},{"output_type":"display_data","data":{"text/plain":["special_tokens_map.json: 0%| | 0.00/389 [00:00<?, ?B/s]"],"application/vnd.jupyter.widget-view+json":{"version_major":2,"version_minor":0,"model_id":"b52a126def7c4e98accef3d3fe88785b"}},"metadata":{}}]},{"cell_type":"code","source":["# Dataset Class\n","class FlickrDataset(Dataset):\n"," def __init__(self, dataframe):\n"," self.data = dataframe\n","\n"," def __len__(self):\n"," return len(self.data)\n","\n"," def __getitem__(self, idx):\n"," image_path = self.data.iloc[idx]['filepath']\n"," caption = self.data.iloc[idx]['comment']\n"," image = Image.open(image_path).convert(\"RGB\")\n"," return {'image': image, 'text': caption} # raw text and PIL image\n","\n","# Collate Function\n","def collate_fn(batch):\n"," texts = [item['text'] for item in batch]\n"," images = [item['image'] for item in batch]\n","\n"," # Use processor to pad text & process images\n"," inputs = processor(\n"," text=texts,\n"," images=images,\n"," return_tensors=\"pt\",\n"," padding=True,\n"," truncation=True\n"," )\n"," return inputs\n","\n","# DataLoader\n","dataset = FlickrDataset(df)\n","dataloader = DataLoader(dataset, batch_size=8, shuffle=True, collate_fn=collate_fn)"],"metadata":{"id":"UcTMGtiakbtK","executionInfo":{"status":"ok","timestamp":1748704212000,"user_tz":-300,"elapsed":43,"user":{"displayName":"Ramzan0001","userId":"17484931948124609414"}}},"execution_count":12,"outputs":[]},{"cell_type":"code","source":["# Training\n","import torch.nn.functional as F\n","\n","# Contrastive loss function\n","loss_fn = CrossEntropyLoss()\n","optimizer = torch.optim.Adam(model.parameters(), lr=5e-6)\n","model.train()\n","\n","for epoch in range(1): # 1 epoch for Colab\n"," for batch in dataloader:\n"," for k in batch:\n"," batch[k] = batch[k].to(device)\n","\n"," # Forward pass\n"," outputs = model(**batch)\n"," image_embeds = outputs.image_embeds # [batch_size, hidden_dim]\n"," text_embeds = outputs.text_embeds # [batch_size, hidden_dim]\n","\n"," # Normalize embeddings\n"," image_embeds = F.normalize(image_embeds, p=2, dim=1)\n"," text_embeds = F.normalize(text_embeds, p=2, dim=1)\n","\n"," # Compute cosine similarity\n"," logits_per_image = image_embeds @ text_embeds.t() # [batch, batch]\n"," logits_per_text = text_embeds @ image_embeds.t() # [batch, batch]\n","\n"," # Labels: diagonal matches\n"," labels = torch.arange(image_embeds.size(0), device=device)\n","\n"," # Compute loss in both directions\n"," loss_i = loss_fn(logits_per_image, labels)\n"," loss_t = loss_fn(logits_per_text, labels)\n"," loss = (loss_i + loss_t) / 2\n","\n"," # Backpropagation\n"," loss.backward()\n"," optimizer.step()\n"," optimizer.zero_grad()\n","\n"," print(f\"Epoch {epoch+1} completed. Loss: {loss.item():.4f}\")"],"metadata":{"colab":{"base_uri":"https://localhost:8080/"},"id":"iZItAujCknvj","executionInfo":{"status":"ok","timestamp":1748705809981,"user_tz":-300,"elapsed":1431090,"user":{"displayName":"Ramzan0001","userId":"17484931948124609414"}},"outputId":"fc96fd89-7953-4bd5-f050-b96d12455d4d"},"execution_count":15,"outputs":[{"output_type":"stream","name":"stdout","text":["Epoch 1 completed. Loss: 1.5125\n"]}]},{"cell_type":"code","source":["model.save_pretrained(save_path)\n","processor.save_pretrained(save_path)\n","\n","print(\">>>Model and Processor saved successfully<<<\")"],"metadata":{"colab":{"base_uri":"https://localhost:8080/"},"id":"V8QA2TfFkwsM","executionInfo":{"status":"ok","timestamp":1748705901389,"user_tz":-300,"elapsed":8150,"user":{"displayName":"Ramzan0001","userId":"17484931948124609414"}},"outputId":"eb9cb948-96c9-4d4f-a0ed-8e9e793dc735"},"execution_count":16,"outputs":[{"output_type":"stream","name":"stdout","text":[">>>Model and Processor saved successfully<<<\n"]}]},{"cell_type":"code","source":[],"metadata":{"id":"Nq7hFTAx_lnx"},"execution_count":null,"outputs":[]}]}
Testing_Model.ipynb ADDED
@@ -0,0 +1 @@
 
 
1
+ {"nbformat":4,"nbformat_minor":0,"metadata":{"colab":{"provenance":[],"authorship_tag":"ABX9TyPX0KJCddQKdgG/BZ7JHsh1"},"kernelspec":{"name":"python3","display_name":"Python 3"},"language_info":{"name":"python"}},"cells":[{"cell_type":"code","source":["!pip install -q torch torchvision pandas ftfy"],"metadata":{"id":"PL0XMNx7C-t3"},"execution_count":null,"outputs":[]},{"cell_type":"code","execution_count":2,"metadata":{"id":"2S6ibSnMCtZs","colab":{"base_uri":"https://localhost:8080/"},"executionInfo":{"status":"ok","timestamp":1748707375302,"user_tz":-300,"elapsed":43159,"user":{"displayName":"Ramzan0001","userId":"17484931948124609414"}},"outputId":"af1d6999-6aae-48ec-8ff6-2fb083b95802"},"outputs":[{"output_type":"stream","name":"stdout","text":["Mounted at /content/drive\n"]}],"source":["from google.colab import drive\n","drive.mount('/content/drive')"]},{"cell_type":"code","source":["# === Paths ===\n","CSV_PATH = '/content/drive/My Drive/CLIP_Project/Data/results.csv'\n","IMG_DIR = '/content/drive/My Drive/CLIP_Project/Data/Testing_Images'\n","MODEL_PATH = '/content/drive/My Drive/CLIP_Project/Model_Files'"],"metadata":{"id":"_HlCWG2zlhjl","executionInfo":{"status":"ok","timestamp":1748707378675,"user_tz":-300,"elapsed":14,"user":{"displayName":"Ramzan0001","userId":"17484931948124609414"}}},"execution_count":3,"outputs":[]},{"cell_type":"code","source":["# === Load Libraries ===\n","import os\n","import pandas as pd\n","from PIL import Image\n","from torch.utils.data import Dataset, DataLoader\n","from transformers import CLIPProcessor, CLIPModel\n","import torch\n","import torch.nn.functional as F\n","from torch.nn import CrossEntropyLoss"],"metadata":{"id":"kSPwCA9aC_F3","executionInfo":{"status":"ok","timestamp":1748707404284,"user_tz":-300,"elapsed":23452,"user":{"displayName":"Ramzan0001","userId":"17484931948124609414"}}},"execution_count":4,"outputs":[]},{"cell_type":"code","source":["device = \"cuda\" if torch.cuda.is_available() else \"cpu\""],"metadata":{"id":"ua0Po_aYDF4a","executionInfo":{"status":"ok","timestamp":1748707424115,"user_tz":-300,"elapsed":41,"user":{"displayName":"Ramzan0001","userId":"17484931948124609414"}}},"execution_count":5,"outputs":[]},{"cell_type":"code","source":["# === Load Model & Processor ===\n","model = CLIPModel.from_pretrained(MODEL_PATH).to(device)\n","processor = CLIPProcessor.from_pretrained(MODEL_PATH)"],"metadata":{"id":"DEqqGaTXDUHT","colab":{"base_uri":"https://localhost:8080/"},"executionInfo":{"status":"ok","timestamp":1748707440975,"user_tz":-300,"elapsed":13704,"user":{"displayName":"Ramzan0001","userId":"17484931948124609414"}},"outputId":"416b991a-8907-4938-9726-f9e42a4a5880"},"execution_count":6,"outputs":[{"output_type":"stream","name":"stderr","text":["Using a slow image processor as `use_fast` is unset and a slow processor was saved with this model. `use_fast=True` will be the default behavior in v4.52, even if the model was saved with a slow processor. This will result in minor differences in outputs. You'll still be able to use a slow processor with `use_fast=False`.\n"]}]},{"cell_type":"code","source":["# === Load and Filter Data ===\n","df = pd.read_csv(CSV_PATH, sep='|', engine='python')\n","df.columns = [col.strip() for col in df.columns]\n","df['image_name'] = df['image_name'].astype(str).str.strip()\n","df['comment'] = df['comment'].astype(str).str.strip()\n","df['comment_number'] = pd.to_numeric(df['comment_number'], errors='coerce')\n","df = df[df['comment_number'] == 0].reset_index(drop=True)\n","df['filepath'] = df['image_name'].apply(lambda x: os.path.join(IMG_DIR, x))\n","df = df[df['filepath'].apply(os.path.exists)].reset_index(drop=True)\n","df = df.sample(n=500, random_state=42).reset_index(drop=True)"],"metadata":{"id":"9Z-vMxDcl5FN","executionInfo":{"status":"ok","timestamp":1748707461829,"user_tz":-300,"elapsed":12329,"user":{"displayName":"Ramzan0001","userId":"17484931948124609414"}}},"execution_count":7,"outputs":[]},{"cell_type":"code","source":["print(df.head(5))"],"metadata":{"colab":{"base_uri":"https://localhost:8080/"},"id":"7yN-pjq_FkYJ","executionInfo":{"status":"ok","timestamp":1748707472354,"user_tz":-300,"elapsed":37,"user":{"displayName":"Ramzan0001","userId":"17484931948124609414"}},"outputId":"716b42b3-e4df-47d7-d0b0-bebf0be084e2"},"execution_count":8,"outputs":[{"output_type":"stream","name":"stdout","text":[" image_name comment_number \\\n","0 505062117.jpg 0.0 \n","1 513390919.jpg 0.0 \n","2 535529555.jpg 0.0 \n","3 493507605.jpg 0.0 \n","4 516433137.jpg 0.0 \n","\n"," comment \\\n","0 A dog swims in the water with a tennis ball in... \n","1 Two young children and a young adult are worki... \n","2 Two dogs try to get the chewed-up red Frisbee ... \n","3 A wet black dog is running away from another b... \n","4 An elderly man lies on a couch in an alleyway ... \n","\n"," filepath \n","0 /content/drive/My Drive/CLIP_Project/Data/Test... \n","1 /content/drive/My Drive/CLIP_Project/Data/Test... \n","2 /content/drive/My Drive/CLIP_Project/Data/Test... \n","3 /content/drive/My Drive/CLIP_Project/Data/Test... \n","4 /content/drive/My Drive/CLIP_Project/Data/Test... \n"]}]},{"cell_type":"code","source":["# === Dataset and DataLoader ===\n","class FlickrTestDataset(Dataset):\n"," def __init__(self, dataframe):\n"," self.data = dataframe\n","\n"," def __len__(self):\n"," return len(self.data)\n","\n"," def __getitem__(self, idx):\n"," image = Image.open(self.data.iloc[idx]['filepath']).convert(\"RGB\")\n"," text = self.data.iloc[idx]['comment']\n"," return {'image': image, 'text': text}\n","\n","def collate_fn(batch):\n"," texts = [item['text'] for item in batch]\n"," images = [item['image'] for item in batch]\n"," return processor(text=texts, images=images, return_tensors=\"pt\", padding=True, truncation=True)\n","\n","test_dataset = FlickrTestDataset(df)\n","test_loader = DataLoader(test_dataset, batch_size=32, shuffle=False, collate_fn=collate_fn)"],"metadata":{"id":"AIh1UcCvl6wH","executionInfo":{"status":"ok","timestamp":1748707477151,"user_tz":-300,"elapsed":48,"user":{"displayName":"Ramzan0001","userId":"17484931948124609414"}}},"execution_count":9,"outputs":[]},{"cell_type":"code","source":["# === Evaluation ===\n","model.eval()\n","loss_fn = CrossEntropyLoss()\n","\n","all_image_embeds = []\n","all_text_embeds = []\n","total_loss = 0.0\n","total_samples = 0\n","correct_image_to_text = 0\n","correct_text_to_image = 0\n","\n","with torch.no_grad():\n"," for batch in test_loader:\n"," batch = {k: v.to(device) for k, v in batch.items()}\n"," outputs = model(**batch)\n","\n"," # Normalize embeddings\n"," image_embeds = F.normalize(outputs.image_embeds, p=2, dim=1)\n"," text_embeds = F.normalize(outputs.text_embeds, p=2, dim=1)\n","\n"," # Store for global similarity matrix\n"," all_image_embeds.append(image_embeds)\n"," all_text_embeds.append(text_embeds)\n","\n"," # Compute similarity\n"," logits_per_image = image_embeds @ text_embeds.T\n"," logits_per_text = text_embeds @ image_embeds.T\n","\n"," labels = torch.arange(image_embeds.size(0), device=device)\n"," loss_i = loss_fn(logits_per_image, labels)\n"," loss_t = loss_fn(logits_per_text, labels)\n"," loss = (loss_i + loss_t) / 2\n","\n"," total_loss += loss.item()\n"," total_samples += 1\n","\n"," # Accuracy (Recall@1)\n"," pred_i2t = torch.argmax(logits_per_image, dim=1)\n"," pred_t2i = torch.argmax(logits_per_text, dim=1)\n"," correct_image_to_text += (pred_i2t == labels).sum().item()\n"," correct_text_to_image += (pred_t2i == labels).sum().item()"],"metadata":{"id":"dOa-zao7l-ya","executionInfo":{"status":"ok","timestamp":1748707734554,"user_tz":-300,"elapsed":250159,"user":{"displayName":"Ramzan0001","userId":"17484931948124609414"}}},"execution_count":10,"outputs":[]},{"cell_type":"code","source":["# === Final Metrics ===\n","avg_loss = total_loss / total_samples\n","accuracy_i2t = correct_image_to_text / len(df)\n","accuracy_t2i = correct_text_to_image / len(df)\n","\n","print(f\"\\nβœ… Testing Completed\")\n","print(f\"πŸ“‰ Average Contrastive Loss: {avg_loss:.4f}\")\n","print(f\"🎯 Accuracy (Image -> Text): {accuracy_i2t*100:.2f}%\")\n","print(f\"🎯 Accuracy (Text -> Image): {accuracy_t2i*100:.2f}%\")"],"metadata":{"colab":{"base_uri":"https://localhost:8080/"},"id":"M2p-NzAbEzoa","executionInfo":{"status":"ok","timestamp":1748707786818,"user_tz":-300,"elapsed":13,"user":{"displayName":"Ramzan0001","userId":"17484931948124609414"}},"outputId":"51398e31-7ea6-4a5d-b4c7-b8e9c32f51da"},"execution_count":11,"outputs":[{"output_type":"stream","name":"stdout","text":["\n","βœ… Testing Completed\n","πŸ“‰ Average Contrastive Loss: 2.7667\n","🎯 Accuracy (Image -> Text): 75.60%\n","🎯 Accuracy (Text -> Image): 76.60%\n"]}]},{"cell_type":"code","source":[],"metadata":{"id":"AAp9D7PfGz6u"},"execution_count":null,"outputs":[]}]}