forestav commited on
Commit
72d5448
·
1 Parent(s): 27ebe17

fix small bug

Browse files
Files changed (1) hide show
  1. training_pipeline.ipynb +19 -100
training_pipeline.ipynb CHANGED
@@ -538,114 +538,33 @@
538
  },
539
  {
540
  "cell_type": "code",
541
- "execution_count": 22,
542
  "metadata": {},
543
  "outputs": [
544
  {
545
- "name": "stdout",
546
- "output_type": "stream",
547
- "text": [
548
- "2025-01-08 19:44:05,458 INFO: Save model to C:\\Users\\Filip\\AppData\\Local\\Temp\\tmpa217ndkp\n"
 
 
 
 
 
 
 
 
 
 
 
 
 
549
  ]
550
- },
551
- {
552
- "data": {
553
- "application/vnd.jupyter.widget-view+json": {
554
- "model_id": "05f6bc89a66a4202b9f3b4b4fadee783",
555
- "version_major": 2,
556
- "version_minor": 0
557
- },
558
- "text/plain": [
559
- "Computing widget examples: 0%| | 0/1 [00:00<?, ?example/s]"
560
- ]
561
- },
562
- "metadata": {},
563
- "output_type": "display_data"
564
- },
565
- {
566
- "data": {
567
- "application/vnd.jupyter.widget-view+json": {
568
- "model_id": "c1688de9db8d46b6ba410bcdcff839fd",
569
- "version_major": 2,
570
- "version_minor": 0
571
- },
572
- "text/plain": [
573
- "Computing widget examples: 0%| | 0/1 [00:00<?, ?example/s]"
574
- ]
575
- },
576
- "metadata": {},
577
- "output_type": "display_data"
578
- },
579
- {
580
- "data": {
581
- "application/vnd.jupyter.widget-view+json": {
582
- "model_id": "c496a24b0d4044ffbbd9278a9f56996d",
583
- "version_major": 2,
584
- "version_minor": 0
585
- },
586
- "text/plain": [
587
- "unigram.json: 0%| | 0.00/14.8M [00:00<?, ?B/s]"
588
- ]
589
- },
590
- "metadata": {},
591
- "output_type": "display_data"
592
- },
593
- {
594
- "data": {
595
- "application/vnd.jupyter.widget-view+json": {
596
- "model_id": "d4f0e6b478aa4a8dad8c798761289a8f",
597
- "version_major": 2,
598
- "version_minor": 0
599
- },
600
- "text/plain": [
601
- "model.safetensors: 0%| | 0.00/471M [00:00<?, ?B/s]"
602
- ]
603
- },
604
- "metadata": {},
605
- "output_type": "display_data"
606
- },
607
- {
608
- "data": {
609
- "application/vnd.jupyter.widget-view+json": {
610
- "model_id": "e2a88564cf8b438bad836c593d4d78f6",
611
- "version_major": 2,
612
- "version_minor": 0
613
- },
614
- "text/plain": [
615
- "Upload 3 LFS files: 0%| | 0/3 [00:00<?, ?it/s]"
616
- ]
617
- },
618
- "metadata": {},
619
- "output_type": "display_data"
620
- },
621
- {
622
- "data": {
623
- "application/vnd.jupyter.widget-view+json": {
624
- "model_id": "b302ff2e4cf74982bccdcf9d3a221240",
625
- "version_major": 2,
626
- "version_minor": 0
627
- },
628
- "text/plain": [
629
- "tokenizer.json: 0%| | 0.00/17.1M [00:00<?, ?B/s]"
630
- ]
631
- },
632
- "metadata": {},
633
- "output_type": "display_data"
634
- },
635
- {
636
- "data": {
637
- "text/plain": [
638
- "'https://huggingface.co/forestav/job_matching_sentence_transformer/commit/7168a70785fae3fee6f5576b40a7556072ba31a2'"
639
- ]
640
- },
641
- "execution_count": 22,
642
- "metadata": {},
643
- "output_type": "execute_result"
644
  }
645
  ],
646
  "source": [
647
  "# Push the model to huggingface\n",
648
- "model.push_to_hub(\"forestav/job_matching_sentence_transformer\")"
649
  ]
650
  }
651
  ],
 
538
  },
539
  {
540
  "cell_type": "code",
541
+ "execution_count": null,
542
  "metadata": {},
543
  "outputs": [
544
  {
545
+ "ename": "HfHubHTTPError",
546
+ "evalue": "409 Client Error: Conflict for url: https://huggingface.co/api/repos/create (Request ID: Root=1-678391c6-22b5b53a19ac4add675f0e05;3fa72b47-baef-4170-8fe3-772ad458534e)\n\nYou already created this model repo",
547
+ "output_type": "error",
548
+ "traceback": [
549
+ "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
550
+ "\u001b[1;31mHTTPError\u001b[0m Traceback (most recent call last)",
551
+ "File \u001b[1;32mc:\\Users\\Filip\\jobsai\\venv\\Lib\\site-packages\\huggingface_hub\\utils\\_http.py:406\u001b[0m, in \u001b[0;36mhf_raise_for_status\u001b[1;34m(response, endpoint_name)\u001b[0m\n\u001b[0;32m 405\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[1;32m--> 406\u001b[0m \u001b[43mresponse\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mraise_for_status\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n\u001b[0;32m 407\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m HTTPError \u001b[38;5;28;01mas\u001b[39;00m e:\n",
552
+ "File \u001b[1;32mc:\\Users\\Filip\\jobsai\\venv\\Lib\\site-packages\\requests\\models.py:1024\u001b[0m, in \u001b[0;36mResponse.raise_for_status\u001b[1;34m(self)\u001b[0m\n\u001b[0;32m 1023\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m http_error_msg:\n\u001b[1;32m-> 1024\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m HTTPError(http_error_msg, response\u001b[38;5;241m=\u001b[39m\u001b[38;5;28mself\u001b[39m)\n",
553
+ "\u001b[1;31mHTTPError\u001b[0m: 409 Client Error: Conflict for url: https://huggingface.co/api/repos/create",
554
+ "\nThe above exception was the direct cause of the following exception:\n",
555
+ "\u001b[1;31mHfHubHTTPError\u001b[0m Traceback (most recent call last)",
556
+ "Cell \u001b[1;32mIn[20], line 2\u001b[0m\n\u001b[0;32m 1\u001b[0m \u001b[38;5;66;03m# Push the model to huggingface\u001b[39;00m\n\u001b[1;32m----> 2\u001b[0m \u001b[43mmodel\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mpush_to_hub\u001b[49m\u001b[43m(\u001b[49m\u001b[43mrepo_id\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mforestav/job_matching_sentence_transformer\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m)\u001b[49m\n",
557
+ "File \u001b[1;32mc:\\Users\\Filip\\jobsai\\venv\\Lib\\site-packages\\sentence_transformers\\SentenceTransformer.py:1370\u001b[0m, in \u001b[0;36mSentenceTransformer.push_to_hub\u001b[1;34m(self, repo_id, token, private, safe_serialization, commit_message, local_model_path, exist_ok, replace_model_card, train_datasets, revision, create_pr)\u001b[0m\n\u001b[0;32m 1350\u001b[0m \u001b[38;5;250m\u001b[39m\u001b[38;5;124;03m\"\"\"\u001b[39;00m\n\u001b[0;32m 1351\u001b[0m \u001b[38;5;124;03mUploads all elements of this Sentence Transformer to a new HuggingFace Hub repository.\u001b[39;00m\n\u001b[0;32m 1352\u001b[0m \n\u001b[1;32m (...)\u001b[0m\n\u001b[0;32m 1367\u001b[0m \u001b[38;5;124;03m str: The url of the commit of your model in the repository on the Hugging Face Hub.\u001b[39;00m\n\u001b[0;32m 1368\u001b[0m \u001b[38;5;124;03m\"\"\"\u001b[39;00m\n\u001b[0;32m 1369\u001b[0m api \u001b[38;5;241m=\u001b[39m HfApi(token\u001b[38;5;241m=\u001b[39mtoken)\n\u001b[1;32m-> 1370\u001b[0m repo_url \u001b[38;5;241m=\u001b[39m \u001b[43mapi\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mcreate_repo\u001b[49m\u001b[43m(\u001b[49m\n\u001b[0;32m 1371\u001b[0m \u001b[43m \u001b[49m\u001b[43mrepo_id\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mrepo_id\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m 1372\u001b[0m \u001b[43m \u001b[49m\u001b[43mprivate\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mprivate\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m 1373\u001b[0m \u001b[43m \u001b[49m\u001b[43mrepo_type\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;28;43;01mNone\u001b[39;49;00m\u001b[43m,\u001b[49m\n\u001b[0;32m 1374\u001b[0m \u001b[43m \u001b[49m\u001b[43mexist_ok\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mexist_ok\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;129;43;01mor\u001b[39;49;00m\u001b[43m \u001b[49m\u001b[43mcreate_pr\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m 1375\u001b[0m \u001b[43m\u001b[49m\u001b[43m)\u001b[49m\n\u001b[0;32m 1376\u001b[0m repo_id \u001b[38;5;241m=\u001b[39m repo_url\u001b[38;5;241m.\u001b[39mrepo_id \u001b[38;5;66;03m# Update the repo_id in case the old repo_id didn't contain a user or organization\u001b[39;00m\n\u001b[0;32m 1377\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mmodel_card_data\u001b[38;5;241m.\u001b[39mset_model_id(repo_id)\n",
558
+ "File \u001b[1;32mc:\\Users\\Filip\\jobsai\\venv\\Lib\\site-packages\\huggingface_hub\\utils\\_validators.py:114\u001b[0m, in \u001b[0;36mvalidate_hf_hub_args.<locals>._inner_fn\u001b[1;34m(*args, **kwargs)\u001b[0m\n\u001b[0;32m 111\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m check_use_auth_token:\n\u001b[0;32m 112\u001b[0m kwargs \u001b[38;5;241m=\u001b[39m smoothly_deprecate_use_auth_token(fn_name\u001b[38;5;241m=\u001b[39mfn\u001b[38;5;241m.\u001b[39m\u001b[38;5;18m__name__\u001b[39m, has_token\u001b[38;5;241m=\u001b[39mhas_token, kwargs\u001b[38;5;241m=\u001b[39mkwargs)\n\u001b[1;32m--> 114\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43mfn\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43margs\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mkwargs\u001b[49m\u001b[43m)\u001b[49m\n",
559
+ "File \u001b[1;32mc:\\Users\\Filip\\jobsai\\venv\\Lib\\site-packages\\huggingface_hub\\hf_api.py:3525\u001b[0m, in \u001b[0;36mHfApi.create_repo\u001b[1;34m(self, repo_id, token, private, repo_type, exist_ok, resource_group_id, space_sdk, space_hardware, space_storage, space_sleep_time, space_secrets, space_variables)\u001b[0m\n\u001b[0;32m 3522\u001b[0m \u001b[38;5;28;01mbreak\u001b[39;00m\n\u001b[0;32m 3524\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[1;32m-> 3525\u001b[0m \u001b[43mhf_raise_for_status\u001b[49m\u001b[43m(\u001b[49m\u001b[43mr\u001b[49m\u001b[43m)\u001b[49m\n\u001b[0;32m 3526\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m HTTPError \u001b[38;5;28;01mas\u001b[39;00m err:\n\u001b[0;32m 3527\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m exist_ok \u001b[38;5;129;01mand\u001b[39;00m err\u001b[38;5;241m.\u001b[39mresponse\u001b[38;5;241m.\u001b[39mstatus_code \u001b[38;5;241m==\u001b[39m \u001b[38;5;241m409\u001b[39m:\n\u001b[0;32m 3528\u001b[0m \u001b[38;5;66;03m# Repo already exists and `exist_ok=True`\u001b[39;00m\n",
560
+ "File \u001b[1;32mc:\\Users\\Filip\\jobsai\\venv\\Lib\\site-packages\\huggingface_hub\\utils\\_http.py:477\u001b[0m, in \u001b[0;36mhf_raise_for_status\u001b[1;34m(response, endpoint_name)\u001b[0m\n\u001b[0;32m 473\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m _format(HfHubHTTPError, message, response) \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01me\u001b[39;00m\n\u001b[0;32m 475\u001b[0m \u001b[38;5;66;03m# Convert `HTTPError` into a `HfHubHTTPError` to display request information\u001b[39;00m\n\u001b[0;32m 476\u001b[0m \u001b[38;5;66;03m# as well (request id and/or server error message)\u001b[39;00m\n\u001b[1;32m--> 477\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m _format(HfHubHTTPError, \u001b[38;5;28mstr\u001b[39m(e), response) \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01me\u001b[39;00m\n",
561
+ "\u001b[1;31mHfHubHTTPError\u001b[0m: 409 Client Error: Conflict for url: https://huggingface.co/api/repos/create (Request ID: Root=1-678391c6-22b5b53a19ac4add675f0e05;3fa72b47-baef-4170-8fe3-772ad458534e)\n\nYou already created this model repo"
562
  ]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
563
  }
564
  ],
565
  "source": [
566
  "# Push the model to huggingface\n",
567
+ "model.push_to_hub(repo_id=\"forestav/job_matching_sentence_transformer\", exist_ok=True)"
568
  ]
569
  }
570
  ],