{"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"pygments_lexer":"ipython3","nbconvert_exporter":"python","version":"3.6.4","file_extension":".py","codemirror_mode":{"name":"ipython","version":3},"name":"python","mimetype":"text/x-python"}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"from transformers import Pix2StructForConditionalGeneration, Pix2StructProcessor, AutoProcessor","metadata":{"execution":{"iopub.status.busy":"2023-06-01T03:42:52.823743Z","iopub.execute_input":"2023-06-01T03:42:52.824304Z","iopub.status.idle":"2023-06-01T03:42:52.828935Z","shell.execute_reply.started":"2023-06-01T03:42:52.824267Z","shell.execute_reply":"2023-06-01T03:42:52.827971Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"#device = torch.device(\"cuda\" if torch.cuda.is_available() else \"cpu\")\nmodel = Pix2StructForConditionalGeneration.from_pretrained(\"google/matcha-plotqa-v1\")\nprocessor = AutoProcessor.from_pretrained(\"google/matcha-plotqa-v1\")","metadata":{"execution":{"iopub.status.busy":"2023-06-01T03:42:57.153105Z","iopub.execute_input":"2023-06-01T03:42:57.15345Z","iopub.status.idle":"2023-06-01T03:43:32.387447Z","shell.execute_reply.started":"2023-06-01T03:42:57.153424Z","shell.execute_reply":"2023-06-01T03:43:32.386361Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"model.save_pretrained(\"matcha-plotqa-v1/\")","metadata":{"execution":{"iopub.status.busy":"2023-06-01T03:43:42.663657Z","iopub.execute_input":"2023-06-01T03:43:42.664709Z","iopub.status.idle":"2023-06-01T03:43:43.957013Z","shell.execute_reply.started":"2023-06-01T03:43:42.664665Z","shell.execute_reply":"2023-06-01T03:43:43.955556Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"processor.save_pretrained(\"matcha-plotqa-v1/\")","metadata":{"execution":{"iopub.status.busy":"2023-06-01T03:43:46.757365Z","iopub.execute_input":"2023-06-01T03:43:46.75807Z","iopub.status.idle":"2023-06-01T03:43:46.841581Z","shell.execute_reply.started":"2023-06-01T03:43:46.758021Z","shell.execute_reply":"2023-06-01T03:43:46.840551Z"},"trusted":true},"execution_count":null,"outputs":[]}]}