"
798 | ],
799 | "text/html": [
800 | "\n",
801 | " \n",
802 | " \n",
803 | "
\n",
804 | " [1000/1000 16:24, Epoch 1000/1000]\n",
805 | "
\n",
806 | " \n",
807 | " \n",
808 | " \n",
809 | " Step | \n",
810 | " Training Loss | \n",
811 | " Validation Loss | \n",
812 | "
\n",
813 | " \n",
814 | " \n",
815 | " \n",
816 | " 100 | \n",
817 | " No log | \n",
818 | " 1.612360 | \n",
819 | "
\n",
820 | " \n",
821 | " 200 | \n",
822 | " No log | \n",
823 | " 1.566668 | \n",
824 | "
\n",
825 | " \n",
826 | " 300 | \n",
827 | " 2.393000 | \n",
828 | " 1.660224 | \n",
829 | "
\n",
830 | " \n",
831 | " 400 | \n",
832 | " 2.393000 | \n",
833 | " 1.736173 | \n",
834 | "
\n",
835 | " \n",
836 | " 500 | \n",
837 | " 0.004200 | \n",
838 | " 1.764009 | \n",
839 | "
\n",
840 | " \n",
841 | " 600 | \n",
842 | " 0.004200 | \n",
843 | " 1.800707 | \n",
844 | "
\n",
845 | " \n",
846 | " 700 | \n",
847 | " 0.004200 | \n",
848 | " 1.779289 | \n",
849 | "
\n",
850 | " \n",
851 | " 800 | \n",
852 | " 0.001600 | \n",
853 | " 1.784427 | \n",
854 | "
\n",
855 | " \n",
856 | " 900 | \n",
857 | " 0.001600 | \n",
858 | " 1.802788 | \n",
859 | "
\n",
860 | " \n",
861 | " 1000 | \n",
862 | " 0.001000 | \n",
863 | " 1.804111 | \n",
864 | "
\n",
865 | " \n",
866 | "
"
867 | ]
868 | },
869 | "metadata": {}
870 | },
871 | {
872 | "output_type": "error",
873 | "ename": "SafetensorError",
874 | "evalue": "Error while serializing: IoError(Os { code: 28, kind: StorageFull, message: \"No space left on device\" })",
875 | "traceback": [
876 | "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
877 | "\u001b[0;31mSafetensorError\u001b[0m Traceback (most recent call last)",
878 | "\u001b[0;32m\u001b[0m in \u001b[0;36m\u001b[0;34m()\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mtrainer\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mtrain\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
879 | "\u001b[0;32m/usr/local/lib/python3.10/dist-packages/transformers/trainer.py\u001b[0m in \u001b[0;36mtrain\u001b[0;34m(self, resume_from_checkpoint, trial, ignore_keys_for_eval, **kwargs)\u001b[0m\n\u001b[1;32m 1769\u001b[0m \u001b[0;31m# Disable progress bars when uploading models during checkpoints to avoid polluting stdout\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1770\u001b[0m \u001b[0mhf_hub_utils\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mdisable_progress_bars\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 1771\u001b[0;31m return inner_training_loop(\n\u001b[0m\u001b[1;32m 1772\u001b[0m \u001b[0margs\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0margs\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1773\u001b[0m \u001b[0mresume_from_checkpoint\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mresume_from_checkpoint\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
880 | "\u001b[0;32m/usr/local/lib/python3.10/dist-packages/transformers/trainer.py\u001b[0m in \u001b[0;36m_inner_training_loop\u001b[0;34m(self, batch_size, args, resume_from_checkpoint, trial, ignore_keys_for_eval)\u001b[0m\n\u001b[1;32m 2191\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mcontrol\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mcallback_handler\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mon_step_end\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0margs\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mstate\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mcontrol\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 2192\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 2193\u001b[0;31m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_maybe_log_save_evaluate\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mtr_loss\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mgrad_norm\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mmodel\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mtrial\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mepoch\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mignore_keys_for_eval\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 2194\u001b[0m \u001b[0;32melse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 2195\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mcontrol\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mcallback_handler\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mon_substep_end\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0margs\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mstate\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mcontrol\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
881 | "\u001b[0;32m/usr/local/lib/python3.10/dist-packages/transformers/trainer.py\u001b[0m in \u001b[0;36m_maybe_log_save_evaluate\u001b[0;34m(self, tr_loss, grad_norm, model, trial, epoch, ignore_keys_for_eval)\u001b[0m\n\u001b[1;32m 2586\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 2587\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mcontrol\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mshould_save\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 2588\u001b[0;31m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_save_checkpoint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mmodel\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mtrial\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mmetrics\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mmetrics\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 2589\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mcontrol\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mcallback_handler\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mon_save\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0margs\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mstate\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mcontrol\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 2590\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n",
882 | "\u001b[0;32m/usr/local/lib/python3.10/dist-packages/transformers/trainer.py\u001b[0m in \u001b[0;36m_save_checkpoint\u001b[0;34m(self, model, trial, metrics)\u001b[0m\n\u001b[1;32m 2654\u001b[0m \u001b[0mrun_dir\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_get_output_dir\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mtrial\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mtrial\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 2655\u001b[0m \u001b[0moutput_dir\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mos\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mpath\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mjoin\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mrun_dir\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mcheckpoint_folder\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 2656\u001b[0;31m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0msave_model\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0moutput_dir\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0m_internal_call\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;32mTrue\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 2657\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 2658\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0;32mnot\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0margs\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0msave_only_model\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
883 | "\u001b[0;32m/usr/local/lib/python3.10/dist-packages/transformers/trainer.py\u001b[0m in \u001b[0;36msave_model\u001b[0;34m(self, output_dir, _internal_call)\u001b[0m\n\u001b[1;32m 3148\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 3149\u001b[0m \u001b[0;32melif\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0margs\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mshould_save\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 3150\u001b[0;31m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_save\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0moutput_dir\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 3151\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 3152\u001b[0m \u001b[0;31m# Push to the Hub when `save_model` is called by the user.\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
884 | "\u001b[0;32m/usr/local/lib/python3.10/dist-packages/transformers/trainer.py\u001b[0m in \u001b[0;36m_save\u001b[0;34m(self, output_dir, state_dict)\u001b[0m\n\u001b[1;32m 3223\u001b[0m \u001b[0mtorch\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0msave\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mstate_dict\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mos\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mpath\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mjoin\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0moutput_dir\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mWEIGHTS_NAME\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 3224\u001b[0m \u001b[0;32melse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 3225\u001b[0;31m self.model.save_pretrained(\n\u001b[0m\u001b[1;32m 3226\u001b[0m \u001b[0moutput_dir\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mstate_dict\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mstate_dict\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0msafe_serialization\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0margs\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0msave_safetensors\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 3227\u001b[0m )\n",
885 | "\u001b[0;32m/usr/local/lib/python3.10/dist-packages/transformers/modeling_utils.py\u001b[0m in \u001b[0;36msave_pretrained\u001b[0;34m(self, save_directory, is_main_process, state_dict, save_function, push_to_hub, max_shard_size, safe_serialization, variant, token, save_peft_format, **kwargs)\u001b[0m\n\u001b[1;32m 2466\u001b[0m \u001b[0;31m# At some point we will need to deal better with save_function (used for TPU and other distributed\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 2467\u001b[0m \u001b[0;31m# joyfulness), but for now this enough.\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 2468\u001b[0;31m \u001b[0msafe_save_file\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mshard\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mos\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mpath\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mjoin\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0msave_directory\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mshard_file\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mmetadata\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;34m{\u001b[0m\u001b[0;34m\"format\"\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0;34m\"pt\"\u001b[0m\u001b[0;34m}\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 2469\u001b[0m \u001b[0;32melse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 2470\u001b[0m \u001b[0msave_function\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mshard\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mos\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mpath\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mjoin\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0msave_directory\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mshard_file\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
886 | "\u001b[0;32m/usr/local/lib/python3.10/dist-packages/safetensors/torch.py\u001b[0m in \u001b[0;36msave_file\u001b[0;34m(tensors, filename, metadata)\u001b[0m\n\u001b[1;32m 279\u001b[0m \u001b[0;31m`\u001b[0m\u001b[0;31m`\u001b[0m\u001b[0;31m`\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 280\u001b[0m \"\"\"\n\u001b[0;32m--> 281\u001b[0;31m \u001b[0mserialize_file\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0m_flatten\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mtensors\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mfilename\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mmetadata\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mmetadata\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 282\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 283\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n",
887 | "\u001b[0;31mSafetensorError\u001b[0m: Error while serializing: IoError(Os { code: 28, kind: StorageFull, message: \"No space left on device\" })"
888 | ]
889 | }
890 | ]
891 | },
892 | {
893 | "cell_type": "code",
894 | "execution_count": null,
895 | "metadata": {
896 | "id": "AXzFb4mDfcnk"
897 | },
898 | "outputs": [],
899 | "source": []
900 | },
901 | {
902 | "cell_type": "code",
903 | "execution_count": null,
904 | "metadata": {
905 | "id": "JzMvoc5xfccW"
906 | },
907 | "outputs": [],
908 | "source": []
909 | },
910 | {
911 | "cell_type": "markdown",
912 | "source": [
913 | "## Only useful if patch size is different then 224"
914 | ],
915 | "metadata": {
916 | "id": "_0dbr6HkAYPY"
917 | }
918 | },
919 | {
920 | "cell_type": "code",
921 | "source": [
922 | "'''\n",
923 | "# Initializing a Kosmos-2 kosmos-2-patch14-224 style configuration\n",
924 | "configuration = Kosmos2Config(\n",
925 | " text_config = {\"max_position_embeddings\" : 2048*2, \"attention_heads\" : 32*4},\n",
926 | " vision_config = {\"image_size\" : 1280, \"patch_size\" : 256}\n",
927 | " )\n",
928 | "# configuration = Kosmos2Config(latent_query_num = 64 * 4)\n",
929 | "# model = Kosmos2ForConditionalGeneration.from_pretrained(\"microsoft/kosmos-2-patch14-224\", config = configuration, ignore_mismatched_sizes=True)\n",
930 | "# num_patches_per_side = 32*math.sqrt(total_tokens_increase_by)\n",
931 | "# total_tokens_increase_by = 64\n",
932 | "# # , num_patch_index_tokens = 1024 * total_tokens_increase_by\n",
933 | "'''"
934 | ],
935 | "metadata": {
936 | "id": "GlAvDEl5AhEM"
937 | },
938 | "execution_count": null,
939 | "outputs": []
940 | },
941 | {
942 | "cell_type": "code",
943 | "execution_count": null,
944 | "metadata": {
945 | "id": "Kpp8VEnsfcZq"
946 | },
947 | "outputs": [],
948 | "source": [
949 | "# copied from https://github.com/microsoft/unilm/blob/97e4923e97d3ee10b57e97013556e3fd0d207a9b/kosmos-2/demo/decode_string.py#L35C1-L75C38\n",
950 | "# (with format modifications)\n",
951 | "def patch_index_to_coordinate(ul_idx: int, lr_idx: int, num_patches_per_side: int):\n",
952 | " # Compute the size of each cell in the grid\n",
953 | " cell_size = 1.0 / num_patches_per_side\n",
954 | "\n",
955 | " # Compute the x and y indices of the upper-left and lower-right corners of the bounding box\n",
956 | " ul_x = ul_idx % num_patches_per_side\n",
957 | " ul_y = ul_idx // num_patches_per_side\n",
958 | "\n",
959 | " lr_x = lr_idx % num_patches_per_side\n",
960 | " lr_y = lr_idx // num_patches_per_side\n",
961 | "\n",
962 | " # Compute the normalized coordinates of the bounding box\n",
963 | " if ul_idx == lr_idx:\n",
964 | " x1 = ul_x * cell_size\n",
965 | " y1 = ul_y * cell_size\n",
966 | " x2 = lr_x * cell_size + cell_size\n",
967 | " y2 = lr_y * cell_size + cell_size\n",
968 | " elif ul_x == lr_x or ul_y == lr_y:\n",
969 | " x1 = ul_x * cell_size\n",
970 | " y1 = ul_y * cell_size\n",
971 | " x2 = lr_x * cell_size + cell_size\n",
972 | " y2 = lr_y * cell_size + cell_size\n",
973 | " else:\n",
974 | " x1 = ul_x * cell_size + cell_size / 2\n",
975 | " y1 = ul_y * cell_size + cell_size / 2\n",
976 | " x2 = lr_x * cell_size + cell_size / 2\n",
977 | " y2 = lr_y * cell_size + cell_size / 2\n",
978 | "\n",
979 | " return x1, y1, x2, y2\n",
980 | "\n",
981 | "\n",
982 | "# copied from https://github.com/microsoft/unilm/blob/97e4923e97d3ee10b57e97013556e3fd0d207a9b/kosmos-2/demo/decode_string.py#L4-L33\n",
983 | "# (with format modifications)\n",
984 | "def extract_entities_with_patch_indices(text):\n",
985 | " # The regular expression pattern for matching the required formats\n",
986 | " pattern = r\"(?:(([^<]+)))?\"\n",
987 | "\n",
988 | " # Find all matches in the given string\n",
989 | " matches = re.finditer(pattern, text)\n",
990 | "\n",
991 | " # Initialize an empty list to store the valid patch_index combinations\n",
992 | " entities_with_patch_indices = []\n",
993 | "\n",
994 | " for match in matches:\n",
995 | " # span of a `phrase` that is between and \n",
996 | " span = match.span(2)\n",
997 | " phrase_tag, phrase, match_content = match.groups()\n",
998 | " if not phrase_tag:\n",
999 | " phrase = None\n",
1000 | " # We take the starting position of ` |
"
1232 | }
1233 | },
1234 | "c018269ce79d4437907dea34e202427c": {
1235 | "model_module": "@jupyter-widgets/base",
1236 | "model_name": "LayoutModel",
1237 | "model_module_version": "1.2.0",
1238 | "state": {
1239 | "_model_module": "@jupyter-widgets/base",
1240 | "_model_module_version": "1.2.0",
1241 | "_model_name": "LayoutModel",
1242 | "_view_count": null,
1243 | "_view_module": "@jupyter-widgets/base",
1244 | "_view_module_version": "1.2.0",
1245 | "_view_name": "LayoutView",
1246 | "align_content": null,
1247 | "align_items": "center",
1248 | "align_self": null,
1249 | "border": null,
1250 | "bottom": null,
1251 | "display": "flex",
1252 | "flex": null,
1253 | "flex_flow": "column",
1254 | "grid_area": null,
1255 | "grid_auto_columns": null,
1256 | "grid_auto_flow": null,
1257 | "grid_auto_rows": null,
1258 | "grid_column": null,
1259 | "grid_gap": null,
1260 | "grid_row": null,
1261 | "grid_template_areas": null,
1262 | "grid_template_columns": null,
1263 | "grid_template_rows": null,
1264 | "height": null,
1265 | "justify_content": null,
1266 | "justify_items": null,
1267 | "left": null,
1268 | "margin": null,
1269 | "max_height": null,
1270 | "max_width": null,
1271 | "min_height": null,
1272 | "min_width": null,
1273 | "object_fit": null,
1274 | "object_position": null,
1275 | "order": null,
1276 | "overflow": null,
1277 | "overflow_x": null,
1278 | "overflow_y": null,
1279 | "padding": null,
1280 | "right": null,
1281 | "top": null,
1282 | "visibility": null,
1283 | "width": "50%"
1284 | }
1285 | },
1286 | "7aa20c1dc69f48a792381c01f5071b8d": {
1287 | "model_module": "@jupyter-widgets/base",
1288 | "model_name": "LayoutModel",
1289 | "model_module_version": "1.2.0",
1290 | "state": {
1291 | "_model_module": "@jupyter-widgets/base",
1292 | "_model_module_version": "1.2.0",
1293 | "_model_name": "LayoutModel",
1294 | "_view_count": null,
1295 | "_view_module": "@jupyter-widgets/base",
1296 | "_view_module_version": "1.2.0",
1297 | "_view_name": "LayoutView",
1298 | "align_content": null,
1299 | "align_items": null,
1300 | "align_self": null,
1301 | "border": null,
1302 | "bottom": null,
1303 | "display": null,
1304 | "flex": null,
1305 | "flex_flow": null,
1306 | "grid_area": null,
1307 | "grid_auto_columns": null,
1308 | "grid_auto_flow": null,
1309 | "grid_auto_rows": null,
1310 | "grid_column": null,
1311 | "grid_gap": null,
1312 | "grid_row": null,
1313 | "grid_template_areas": null,
1314 | "grid_template_columns": null,
1315 | "grid_template_rows": null,
1316 | "height": null,
1317 | "justify_content": null,
1318 | "justify_items": null,
1319 | "left": null,
1320 | "margin": null,
1321 | "max_height": null,
1322 | "max_width": null,
1323 | "min_height": null,
1324 | "min_width": null,
1325 | "object_fit": null,
1326 | "object_position": null,
1327 | "order": null,
1328 | "overflow": null,
1329 | "overflow_x": null,
1330 | "overflow_y": null,
1331 | "padding": null,
1332 | "right": null,
1333 | "top": null,
1334 | "visibility": null,
1335 | "width": null
1336 | }
1337 | },
1338 | "62afc0a26592489ba0ed297bde5d4357": {
1339 | "model_module": "@jupyter-widgets/controls",
1340 | "model_name": "DescriptionStyleModel",
1341 | "model_module_version": "1.5.0",
1342 | "state": {
1343 | "_model_module": "@jupyter-widgets/controls",
1344 | "_model_module_version": "1.5.0",
1345 | "_model_name": "DescriptionStyleModel",
1346 | "_view_count": null,
1347 | "_view_module": "@jupyter-widgets/base",
1348 | "_view_module_version": "1.2.0",
1349 | "_view_name": "StyleView",
1350 | "description_width": ""
1351 | }
1352 | },
1353 | "1b7101c5d9dd440b846e60aa4c26fb72": {
1354 | "model_module": "@jupyter-widgets/base",
1355 | "model_name": "LayoutModel",
1356 | "model_module_version": "1.2.0",
1357 | "state": {
1358 | "_model_module": "@jupyter-widgets/base",
1359 | "_model_module_version": "1.2.0",
1360 | "_model_name": "LayoutModel",
1361 | "_view_count": null,
1362 | "_view_module": "@jupyter-widgets/base",
1363 | "_view_module_version": "1.2.0",
1364 | "_view_name": "LayoutView",
1365 | "align_content": null,
1366 | "align_items": null,
1367 | "align_self": null,
1368 | "border": null,
1369 | "bottom": null,
1370 | "display": null,
1371 | "flex": null,
1372 | "flex_flow": null,
1373 | "grid_area": null,
1374 | "grid_auto_columns": null,
1375 | "grid_auto_flow": null,
1376 | "grid_auto_rows": null,
1377 | "grid_column": null,
1378 | "grid_gap": null,
1379 | "grid_row": null,
1380 | "grid_template_areas": null,
1381 | "grid_template_columns": null,
1382 | "grid_template_rows": null,
1383 | "height": null,
1384 | "justify_content": null,
1385 | "justify_items": null,
1386 | "left": null,
1387 | "margin": null,
1388 | "max_height": null,
1389 | "max_width": null,
1390 | "min_height": null,
1391 | "min_width": null,
1392 | "object_fit": null,
1393 | "object_position": null,
1394 | "order": null,
1395 | "overflow": null,
1396 | "overflow_x": null,
1397 | "overflow_y": null,
1398 | "padding": null,
1399 | "right": null,
1400 | "top": null,
1401 | "visibility": null,
1402 | "width": null
1403 | }
1404 | },
1405 | "cef699be72da4aaeb370f71a6ac356a9": {
1406 | "model_module": "@jupyter-widgets/controls",
1407 | "model_name": "DescriptionStyleModel",
1408 | "model_module_version": "1.5.0",
1409 | "state": {
1410 | "_model_module": "@jupyter-widgets/controls",
1411 | "_model_module_version": "1.5.0",
1412 | "_model_name": "DescriptionStyleModel",
1413 | "_view_count": null,
1414 | "_view_module": "@jupyter-widgets/base",
1415 | "_view_module_version": "1.2.0",
1416 | "_view_name": "StyleView",
1417 | "description_width": ""
1418 | }
1419 | },
1420 | "50f583f944274cb9a49c0362b7acd713": {
1421 | "model_module": "@jupyter-widgets/base",
1422 | "model_name": "LayoutModel",
1423 | "model_module_version": "1.2.0",
1424 | "state": {
1425 | "_model_module": "@jupyter-widgets/base",
1426 | "_model_module_version": "1.2.0",
1427 | "_model_name": "LayoutModel",
1428 | "_view_count": null,
1429 | "_view_module": "@jupyter-widgets/base",
1430 | "_view_module_version": "1.2.0",
1431 | "_view_name": "LayoutView",
1432 | "align_content": null,
1433 | "align_items": null,
1434 | "align_self": null,
1435 | "border": null,
1436 | "bottom": null,
1437 | "display": null,
1438 | "flex": null,
1439 | "flex_flow": null,
1440 | "grid_area": null,
1441 | "grid_auto_columns": null,
1442 | "grid_auto_flow": null,
1443 | "grid_auto_rows": null,
1444 | "grid_column": null,
1445 | "grid_gap": null,
1446 | "grid_row": null,
1447 | "grid_template_areas": null,
1448 | "grid_template_columns": null,
1449 | "grid_template_rows": null,
1450 | "height": null,
1451 | "justify_content": null,
1452 | "justify_items": null,
1453 | "left": null,
1454 | "margin": null,
1455 | "max_height": null,
1456 | "max_width": null,
1457 | "min_height": null,
1458 | "min_width": null,
1459 | "object_fit": null,
1460 | "object_position": null,
1461 | "order": null,
1462 | "overflow": null,
1463 | "overflow_x": null,
1464 | "overflow_y": null,
1465 | "padding": null,
1466 | "right": null,
1467 | "top": null,
1468 | "visibility": null,
1469 | "width": null
1470 | }
1471 | },
1472 | "55f4ee25f1484576bb33cf476e2aa038": {
1473 | "model_module": "@jupyter-widgets/controls",
1474 | "model_name": "DescriptionStyleModel",
1475 | "model_module_version": "1.5.0",
1476 | "state": {
1477 | "_model_module": "@jupyter-widgets/controls",
1478 | "_model_module_version": "1.5.0",
1479 | "_model_name": "DescriptionStyleModel",
1480 | "_view_count": null,
1481 | "_view_module": "@jupyter-widgets/base",
1482 | "_view_module_version": "1.2.0",
1483 | "_view_name": "StyleView",
1484 | "description_width": ""
1485 | }
1486 | },
1487 | "85495656479c4323bd62279b8ef544d3": {
1488 | "model_module": "@jupyter-widgets/base",
1489 | "model_name": "LayoutModel",
1490 | "model_module_version": "1.2.0",
1491 | "state": {
1492 | "_model_module": "@jupyter-widgets/base",
1493 | "_model_module_version": "1.2.0",
1494 | "_model_name": "LayoutModel",
1495 | "_view_count": null,
1496 | "_view_module": "@jupyter-widgets/base",
1497 | "_view_module_version": "1.2.0",
1498 | "_view_name": "LayoutView",
1499 | "align_content": null,
1500 | "align_items": null,
1501 | "align_self": null,
1502 | "border": null,
1503 | "bottom": null,
1504 | "display": null,
1505 | "flex": null,
1506 | "flex_flow": null,
1507 | "grid_area": null,
1508 | "grid_auto_columns": null,
1509 | "grid_auto_flow": null,
1510 | "grid_auto_rows": null,
1511 | "grid_column": null,
1512 | "grid_gap": null,
1513 | "grid_row": null,
1514 | "grid_template_areas": null,
1515 | "grid_template_columns": null,
1516 | "grid_template_rows": null,
1517 | "height": null,
1518 | "justify_content": null,
1519 | "justify_items": null,
1520 | "left": null,
1521 | "margin": null,
1522 | "max_height": null,
1523 | "max_width": null,
1524 | "min_height": null,
1525 | "min_width": null,
1526 | "object_fit": null,
1527 | "object_position": null,
1528 | "order": null,
1529 | "overflow": null,
1530 | "overflow_x": null,
1531 | "overflow_y": null,
1532 | "padding": null,
1533 | "right": null,
1534 | "top": null,
1535 | "visibility": null,
1536 | "width": null
1537 | }
1538 | },
1539 | "afed23dafec44c079cda02c1268e8a6d": {
1540 | "model_module": "@jupyter-widgets/controls",
1541 | "model_name": "ButtonStyleModel",
1542 | "model_module_version": "1.5.0",
1543 | "state": {
1544 | "_model_module": "@jupyter-widgets/controls",
1545 | "_model_module_version": "1.5.0",
1546 | "_model_name": "ButtonStyleModel",
1547 | "_view_count": null,
1548 | "_view_module": "@jupyter-widgets/base",
1549 | "_view_module_version": "1.2.0",
1550 | "_view_name": "StyleView",
1551 | "button_color": null,
1552 | "font_weight": ""
1553 | }
1554 | },
1555 | "7f87103d999a40dcaa4efe8d75843da2": {
1556 | "model_module": "@jupyter-widgets/base",
1557 | "model_name": "LayoutModel",
1558 | "model_module_version": "1.2.0",
1559 | "state": {
1560 | "_model_module": "@jupyter-widgets/base",
1561 | "_model_module_version": "1.2.0",
1562 | "_model_name": "LayoutModel",
1563 | "_view_count": null,
1564 | "_view_module": "@jupyter-widgets/base",
1565 | "_view_module_version": "1.2.0",
1566 | "_view_name": "LayoutView",
1567 | "align_content": null,
1568 | "align_items": null,
1569 | "align_self": null,
1570 | "border": null,
1571 | "bottom": null,
1572 | "display": null,
1573 | "flex": null,
1574 | "flex_flow": null,
1575 | "grid_area": null,
1576 | "grid_auto_columns": null,
1577 | "grid_auto_flow": null,
1578 | "grid_auto_rows": null,
1579 | "grid_column": null,
1580 | "grid_gap": null,
1581 | "grid_row": null,
1582 | "grid_template_areas": null,
1583 | "grid_template_columns": null,
1584 | "grid_template_rows": null,
1585 | "height": null,
1586 | "justify_content": null,
1587 | "justify_items": null,
1588 | "left": null,
1589 | "margin": null,
1590 | "max_height": null,
1591 | "max_width": null,
1592 | "min_height": null,
1593 | "min_width": null,
1594 | "object_fit": null,
1595 | "object_position": null,
1596 | "order": null,
1597 | "overflow": null,
1598 | "overflow_x": null,
1599 | "overflow_y": null,
1600 | "padding": null,
1601 | "right": null,
1602 | "top": null,
1603 | "visibility": null,
1604 | "width": null
1605 | }
1606 | },
1607 | "d89b8da9708744bf92eb71c5b5ca48a5": {
1608 | "model_module": "@jupyter-widgets/controls",
1609 | "model_name": "DescriptionStyleModel",
1610 | "model_module_version": "1.5.0",
1611 | "state": {
1612 | "_model_module": "@jupyter-widgets/controls",
1613 | "_model_module_version": "1.5.0",
1614 | "_model_name": "DescriptionStyleModel",
1615 | "_view_count": null,
1616 | "_view_module": "@jupyter-widgets/base",
1617 | "_view_module_version": "1.2.0",
1618 | "_view_name": "StyleView",
1619 | "description_width": ""
1620 | }
1621 | },
1622 | "23552beda4c94263bafbe834ed283921": {
1623 | "model_module": "@jupyter-widgets/controls",
1624 | "model_name": "LabelModel",
1625 | "model_module_version": "1.5.0",
1626 | "state": {
1627 | "_dom_classes": [],
1628 | "_model_module": "@jupyter-widgets/controls",
1629 | "_model_module_version": "1.5.0",
1630 | "_model_name": "LabelModel",
1631 | "_view_count": null,
1632 | "_view_module": "@jupyter-widgets/controls",
1633 | "_view_module_version": "1.5.0",
1634 | "_view_name": "LabelView",
1635 | "description": "",
1636 | "description_tooltip": null,
1637 | "layout": "IPY_MODEL_a59dc124d8104c0ab29574e281885dd9",
1638 | "placeholder": "",
1639 | "style": "IPY_MODEL_e2f52d9a90764140bbfcc4c6f6c4589c",
1640 | "value": "Connecting..."
1641 | }
1642 | },
1643 | "a59dc124d8104c0ab29574e281885dd9": {
1644 | "model_module": "@jupyter-widgets/base",
1645 | "model_name": "LayoutModel",
1646 | "model_module_version": "1.2.0",
1647 | "state": {
1648 | "_model_module": "@jupyter-widgets/base",
1649 | "_model_module_version": "1.2.0",
1650 | "_model_name": "LayoutModel",
1651 | "_view_count": null,
1652 | "_view_module": "@jupyter-widgets/base",
1653 | "_view_module_version": "1.2.0",
1654 | "_view_name": "LayoutView",
1655 | "align_content": null,
1656 | "align_items": null,
1657 | "align_self": null,
1658 | "border": null,
1659 | "bottom": null,
1660 | "display": null,
1661 | "flex": null,
1662 | "flex_flow": null,
1663 | "grid_area": null,
1664 | "grid_auto_columns": null,
1665 | "grid_auto_flow": null,
1666 | "grid_auto_rows": null,
1667 | "grid_column": null,
1668 | "grid_gap": null,
1669 | "grid_row": null,
1670 | "grid_template_areas": null,
1671 | "grid_template_columns": null,
1672 | "grid_template_rows": null,
1673 | "height": null,
1674 | "justify_content": null,
1675 | "justify_items": null,
1676 | "left": null,
1677 | "margin": null,
1678 | "max_height": null,
1679 | "max_width": null,
1680 | "min_height": null,
1681 | "min_width": null,
1682 | "object_fit": null,
1683 | "object_position": null,
1684 | "order": null,
1685 | "overflow": null,
1686 | "overflow_x": null,
1687 | "overflow_y": null,
1688 | "padding": null,
1689 | "right": null,
1690 | "top": null,
1691 | "visibility": null,
1692 | "width": null
1693 | }
1694 | },
1695 | "e2f52d9a90764140bbfcc4c6f6c4589c": {
1696 | "model_module": "@jupyter-widgets/controls",
1697 | "model_name": "DescriptionStyleModel",
1698 | "model_module_version": "1.5.0",
1699 | "state": {
1700 | "_model_module": "@jupyter-widgets/controls",
1701 | "_model_module_version": "1.5.0",
1702 | "_model_name": "DescriptionStyleModel",
1703 | "_view_count": null,
1704 | "_view_module": "@jupyter-widgets/base",
1705 | "_view_module_version": "1.2.0",
1706 | "_view_name": "StyleView",
1707 | "description_width": ""
1708 | }
1709 | },
1710 | "123e74f8e0a8412f9bbf8b2e918d99d8": {
1711 | "model_module": "@jupyter-widgets/controls",
1712 | "model_name": "LabelModel",
1713 | "model_module_version": "1.5.0",
1714 | "state": {
1715 | "_dom_classes": [],
1716 | "_model_module": "@jupyter-widgets/controls",
1717 | "_model_module_version": "1.5.0",
1718 | "_model_name": "LabelModel",
1719 | "_view_count": null,
1720 | "_view_module": "@jupyter-widgets/controls",
1721 | "_view_module_version": "1.5.0",
1722 | "_view_name": "LabelView",
1723 | "description": "",
1724 | "description_tooltip": null,
1725 | "layout": "IPY_MODEL_a3b62f55344340fa9f0db744ff2c8c70",
1726 | "placeholder": "",
1727 | "style": "IPY_MODEL_e4ee7889597f4f078504df0a19976c69",
1728 | "value": "Token is valid (permission: write)."
1729 | }
1730 | },
1731 | "523f4a3541094d38a8dbc4dd3ef9c928": {
1732 | "model_module": "@jupyter-widgets/controls",
1733 | "model_name": "LabelModel",
1734 | "model_module_version": "1.5.0",
1735 | "state": {
1736 | "_dom_classes": [],
1737 | "_model_module": "@jupyter-widgets/controls",
1738 | "_model_module_version": "1.5.0",
1739 | "_model_name": "LabelModel",
1740 | "_view_count": null,
1741 | "_view_module": "@jupyter-widgets/controls",
1742 | "_view_module_version": "1.5.0",
1743 | "_view_name": "LabelView",
1744 | "description": "",
1745 | "description_tooltip": null,
1746 | "layout": "IPY_MODEL_7a98f305582c46d890a3f599f4dc9cf3",
1747 | "placeholder": "",
1748 | "style": "IPY_MODEL_803b81733b7e4bafa94100201436ceb9",
1749 | "value": "Your token has been saved in your configured git credential helpers (store)."
1750 | }
1751 | },
1752 | "b20db9890b464247a9ef7e4fb1adb732": {
1753 | "model_module": "@jupyter-widgets/controls",
1754 | "model_name": "LabelModel",
1755 | "model_module_version": "1.5.0",
1756 | "state": {
1757 | "_dom_classes": [],
1758 | "_model_module": "@jupyter-widgets/controls",
1759 | "_model_module_version": "1.5.0",
1760 | "_model_name": "LabelModel",
1761 | "_view_count": null,
1762 | "_view_module": "@jupyter-widgets/controls",
1763 | "_view_module_version": "1.5.0",
1764 | "_view_name": "LabelView",
1765 | "description": "",
1766 | "description_tooltip": null,
1767 | "layout": "IPY_MODEL_bc2570f343ed47e7bd296162db9e43a7",
1768 | "placeholder": "",
1769 | "style": "IPY_MODEL_7efc9dc702fd40469875f367a90c126a",
1770 | "value": "Your token has been saved to /root/.cache/huggingface/token"
1771 | }
1772 | },
1773 | "b3984a95687d4b978a25fa153ec0a877": {
1774 | "model_module": "@jupyter-widgets/controls",
1775 | "model_name": "LabelModel",
1776 | "model_module_version": "1.5.0",
1777 | "state": {
1778 | "_dom_classes": [],
1779 | "_model_module": "@jupyter-widgets/controls",
1780 | "_model_module_version": "1.5.0",
1781 | "_model_name": "LabelModel",
1782 | "_view_count": null,
1783 | "_view_module": "@jupyter-widgets/controls",
1784 | "_view_module_version": "1.5.0",
1785 | "_view_name": "LabelView",
1786 | "description": "",
1787 | "description_tooltip": null,
1788 | "layout": "IPY_MODEL_985f228d52e34ac39be0fd52a2dce7c3",
1789 | "placeholder": "",
1790 | "style": "IPY_MODEL_7879ea9286004824b34798805700d5b7",
1791 | "value": "Login successful"
1792 | }
1793 | },
1794 | "a3b62f55344340fa9f0db744ff2c8c70": {
1795 | "model_module": "@jupyter-widgets/base",
1796 | "model_name": "LayoutModel",
1797 | "model_module_version": "1.2.0",
1798 | "state": {
1799 | "_model_module": "@jupyter-widgets/base",
1800 | "_model_module_version": "1.2.0",
1801 | "_model_name": "LayoutModel",
1802 | "_view_count": null,
1803 | "_view_module": "@jupyter-widgets/base",
1804 | "_view_module_version": "1.2.0",
1805 | "_view_name": "LayoutView",
1806 | "align_content": null,
1807 | "align_items": null,
1808 | "align_self": null,
1809 | "border": null,
1810 | "bottom": null,
1811 | "display": null,
1812 | "flex": null,
1813 | "flex_flow": null,
1814 | "grid_area": null,
1815 | "grid_auto_columns": null,
1816 | "grid_auto_flow": null,
1817 | "grid_auto_rows": null,
1818 | "grid_column": null,
1819 | "grid_gap": null,
1820 | "grid_row": null,
1821 | "grid_template_areas": null,
1822 | "grid_template_columns": null,
1823 | "grid_template_rows": null,
1824 | "height": null,
1825 | "justify_content": null,
1826 | "justify_items": null,
1827 | "left": null,
1828 | "margin": null,
1829 | "max_height": null,
1830 | "max_width": null,
1831 | "min_height": null,
1832 | "min_width": null,
1833 | "object_fit": null,
1834 | "object_position": null,
1835 | "order": null,
1836 | "overflow": null,
1837 | "overflow_x": null,
1838 | "overflow_y": null,
1839 | "padding": null,
1840 | "right": null,
1841 | "top": null,
1842 | "visibility": null,
1843 | "width": null
1844 | }
1845 | },
1846 | "e4ee7889597f4f078504df0a19976c69": {
1847 | "model_module": "@jupyter-widgets/controls",
1848 | "model_name": "DescriptionStyleModel",
1849 | "model_module_version": "1.5.0",
1850 | "state": {
1851 | "_model_module": "@jupyter-widgets/controls",
1852 | "_model_module_version": "1.5.0",
1853 | "_model_name": "DescriptionStyleModel",
1854 | "_view_count": null,
1855 | "_view_module": "@jupyter-widgets/base",
1856 | "_view_module_version": "1.2.0",
1857 | "_view_name": "StyleView",
1858 | "description_width": ""
1859 | }
1860 | },
1861 | "7a98f305582c46d890a3f599f4dc9cf3": {
1862 | "model_module": "@jupyter-widgets/base",
1863 | "model_name": "LayoutModel",
1864 | "model_module_version": "1.2.0",
1865 | "state": {
1866 | "_model_module": "@jupyter-widgets/base",
1867 | "_model_module_version": "1.2.0",
1868 | "_model_name": "LayoutModel",
1869 | "_view_count": null,
1870 | "_view_module": "@jupyter-widgets/base",
1871 | "_view_module_version": "1.2.0",
1872 | "_view_name": "LayoutView",
1873 | "align_content": null,
1874 | "align_items": null,
1875 | "align_self": null,
1876 | "border": null,
1877 | "bottom": null,
1878 | "display": null,
1879 | "flex": null,
1880 | "flex_flow": null,
1881 | "grid_area": null,
1882 | "grid_auto_columns": null,
1883 | "grid_auto_flow": null,
1884 | "grid_auto_rows": null,
1885 | "grid_column": null,
1886 | "grid_gap": null,
1887 | "grid_row": null,
1888 | "grid_template_areas": null,
1889 | "grid_template_columns": null,
1890 | "grid_template_rows": null,
1891 | "height": null,
1892 | "justify_content": null,
1893 | "justify_items": null,
1894 | "left": null,
1895 | "margin": null,
1896 | "max_height": null,
1897 | "max_width": null,
1898 | "min_height": null,
1899 | "min_width": null,
1900 | "object_fit": null,
1901 | "object_position": null,
1902 | "order": null,
1903 | "overflow": null,
1904 | "overflow_x": null,
1905 | "overflow_y": null,
1906 | "padding": null,
1907 | "right": null,
1908 | "top": null,
1909 | "visibility": null,
1910 | "width": null
1911 | }
1912 | },
1913 | "803b81733b7e4bafa94100201436ceb9": {
1914 | "model_module": "@jupyter-widgets/controls",
1915 | "model_name": "DescriptionStyleModel",
1916 | "model_module_version": "1.5.0",
1917 | "state": {
1918 | "_model_module": "@jupyter-widgets/controls",
1919 | "_model_module_version": "1.5.0",
1920 | "_model_name": "DescriptionStyleModel",
1921 | "_view_count": null,
1922 | "_view_module": "@jupyter-widgets/base",
1923 | "_view_module_version": "1.2.0",
1924 | "_view_name": "StyleView",
1925 | "description_width": ""
1926 | }
1927 | },
1928 | "bc2570f343ed47e7bd296162db9e43a7": {
1929 | "model_module": "@jupyter-widgets/base",
1930 | "model_name": "LayoutModel",
1931 | "model_module_version": "1.2.0",
1932 | "state": {
1933 | "_model_module": "@jupyter-widgets/base",
1934 | "_model_module_version": "1.2.0",
1935 | "_model_name": "LayoutModel",
1936 | "_view_count": null,
1937 | "_view_module": "@jupyter-widgets/base",
1938 | "_view_module_version": "1.2.0",
1939 | "_view_name": "LayoutView",
1940 | "align_content": null,
1941 | "align_items": null,
1942 | "align_self": null,
1943 | "border": null,
1944 | "bottom": null,
1945 | "display": null,
1946 | "flex": null,
1947 | "flex_flow": null,
1948 | "grid_area": null,
1949 | "grid_auto_columns": null,
1950 | "grid_auto_flow": null,
1951 | "grid_auto_rows": null,
1952 | "grid_column": null,
1953 | "grid_gap": null,
1954 | "grid_row": null,
1955 | "grid_template_areas": null,
1956 | "grid_template_columns": null,
1957 | "grid_template_rows": null,
1958 | "height": null,
1959 | "justify_content": null,
1960 | "justify_items": null,
1961 | "left": null,
1962 | "margin": null,
1963 | "max_height": null,
1964 | "max_width": null,
1965 | "min_height": null,
1966 | "min_width": null,
1967 | "object_fit": null,
1968 | "object_position": null,
1969 | "order": null,
1970 | "overflow": null,
1971 | "overflow_x": null,
1972 | "overflow_y": null,
1973 | "padding": null,
1974 | "right": null,
1975 | "top": null,
1976 | "visibility": null,
1977 | "width": null
1978 | }
1979 | },
1980 | "7efc9dc702fd40469875f367a90c126a": {
1981 | "model_module": "@jupyter-widgets/controls",
1982 | "model_name": "DescriptionStyleModel",
1983 | "model_module_version": "1.5.0",
1984 | "state": {
1985 | "_model_module": "@jupyter-widgets/controls",
1986 | "_model_module_version": "1.5.0",
1987 | "_model_name": "DescriptionStyleModel",
1988 | "_view_count": null,
1989 | "_view_module": "@jupyter-widgets/base",
1990 | "_view_module_version": "1.2.0",
1991 | "_view_name": "StyleView",
1992 | "description_width": ""
1993 | }
1994 | },
1995 | "985f228d52e34ac39be0fd52a2dce7c3": {
1996 | "model_module": "@jupyter-widgets/base",
1997 | "model_name": "LayoutModel",
1998 | "model_module_version": "1.2.0",
1999 | "state": {
2000 | "_model_module": "@jupyter-widgets/base",
2001 | "_model_module_version": "1.2.0",
2002 | "_model_name": "LayoutModel",
2003 | "_view_count": null,
2004 | "_view_module": "@jupyter-widgets/base",
2005 | "_view_module_version": "1.2.0",
2006 | "_view_name": "LayoutView",
2007 | "align_content": null,
2008 | "align_items": null,
2009 | "align_self": null,
2010 | "border": null,
2011 | "bottom": null,
2012 | "display": null,
2013 | "flex": null,
2014 | "flex_flow": null,
2015 | "grid_area": null,
2016 | "grid_auto_columns": null,
2017 | "grid_auto_flow": null,
2018 | "grid_auto_rows": null,
2019 | "grid_column": null,
2020 | "grid_gap": null,
2021 | "grid_row": null,
2022 | "grid_template_areas": null,
2023 | "grid_template_columns": null,
2024 | "grid_template_rows": null,
2025 | "height": null,
2026 | "justify_content": null,
2027 | "justify_items": null,
2028 | "left": null,
2029 | "margin": null,
2030 | "max_height": null,
2031 | "max_width": null,
2032 | "min_height": null,
2033 | "min_width": null,
2034 | "object_fit": null,
2035 | "object_position": null,
2036 | "order": null,
2037 | "overflow": null,
2038 | "overflow_x": null,
2039 | "overflow_y": null,
2040 | "padding": null,
2041 | "right": null,
2042 | "top": null,
2043 | "visibility": null,
2044 | "width": null
2045 | }
2046 | },
2047 | "7879ea9286004824b34798805700d5b7": {
2048 | "model_module": "@jupyter-widgets/controls",
2049 | "model_name": "DescriptionStyleModel",
2050 | "model_module_version": "1.5.0",
2051 | "state": {
2052 | "_model_module": "@jupyter-widgets/controls",
2053 | "_model_module_version": "1.5.0",
2054 | "_model_name": "DescriptionStyleModel",
2055 | "_view_count": null,
2056 | "_view_module": "@jupyter-widgets/base",
2057 | "_view_module_version": "1.2.0",
2058 | "_view_name": "StyleView",
2059 | "description_width": ""
2060 | }
2061 | }
2062 | }
2063 | }
2064 | },
2065 | "nbformat": 4,
2066 | "nbformat_minor": 0
2067 | }
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Document-AI
--------------------------------------------------------------------------------
/test.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mit1208/Document-AI/f096be50902e501b2ef3ad9144eea79f702907b1/test.png
--------------------------------------------------------------------------------