{"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"name":"python","version":"3.10.13","mimetype":"text/x-python","codemirror_mode":{"name":"ipython","version":3},"pygments_lexer":"ipython3","nbconvert_exporter":"python","file_extension":".py"},"kaggle":{"accelerator":"nvidiaTeslaT4","dataSources":[],"dockerImageVersionId":30733,"isInternetEnabled":true,"language":"python","sourceType":"notebook","isGpuEnabled":true}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"markdown","source":"## Load dataset","metadata":{}},{"cell_type":"code","source":"from datasets import load_dataset","metadata":{"execution":{"iopub.status.busy":"2024-07-06T11:39:56.584242Z","iopub.execute_input":"2024-07-06T11:39:56.584593Z","iopub.status.idle":"2024-07-06T11:39:58.156952Z","shell.execute_reply.started":"2024-07-06T11:39:56.584562Z","shell.execute_reply":"2024-07-06T11:39:58.155992Z"},"trusted":true},"execution_count":1,"outputs":[]},{"cell_type":"code","source":"shoe_dataset = load_dataset(\"mazed/amazon_shoe_review\")","metadata":{"execution":{"iopub.status.busy":"2024-07-06T11:39:58.158713Z","iopub.execute_input":"2024-07-06T11:39:58.159533Z","iopub.status.idle":"2024-07-06T11:40:01.257551Z","shell.execute_reply.started":"2024-07-06T11:39:58.159500Z","shell.execute_reply":"2024-07-06T11:40:01.256701Z"},"trusted":true},"execution_count":2,"outputs":[{"output_type":"display_data","data":{"text/plain":"Downloading readme: 0%| | 0.00/456 [00:00","text/html":"wandb version 0.17.4 is available! To upgrade, please run:\n $ pip install wandb --upgrade"},"metadata":{}},{"output_type":"display_data","data":{"text/plain":"","text/html":"Tracking run with wandb version 0.17.0"},"metadata":{}},{"output_type":"display_data","data":{"text/plain":"","text/html":"Run data is saved locally in /kaggle/working/wandb/run-20240706_114220-bb9lw437"},"metadata":{}},{"output_type":"display_data","data":{"text/plain":"","text/html":"Syncing run bert-base-uncased-finetune-sst2 to Weights & Biases (docs)
"},"metadata":{}},{"output_type":"display_data","data":{"text/plain":"","text/html":" View project at https://wandb.ai/almazed9-SEC/huggingface"},"metadata":{}},{"output_type":"display_data","data":{"text/plain":"","text/html":" View run at https://wandb.ai/almazed9-SEC/huggingface/runs/bb9lw437"},"metadata":{}},{"name":"stderr","text":"/opt/conda/lib/python3.10/site-packages/torch/nn/parallel/_functions.py:68: UserWarning: Was asked to gather along dimension 0, but all input tensors were scalars; will instead unsqueeze and return a vector.\n warnings.warn('Was asked to gather along dimension 0, but all '\n","output_type":"stream"},{"output_type":"display_data","data":{"text/plain":"","text/html":"\n
\n \n \n [4221/4221 1:52:37, Epoch 3/3]\n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
EpochTraining LossValidation LossAccuracyF1PrecisionRecall
11.0092000.9482700.5769000.5719400.5727440.576900
20.8831000.9372860.5826000.5817430.5848370.582600
30.7738000.9759220.5820000.5809530.5814240.582000

"},"metadata":{}},{"name":"stderr","text":"/opt/conda/lib/python3.10/site-packages/torch/nn/parallel/_functions.py:68: UserWarning: Was asked to gather along dimension 0, but all input tensors were scalars; will instead unsqueeze and return a vector.\n warnings.warn('Was asked to gather along dimension 0, but all '\n/opt/conda/lib/python3.10/site-packages/torch/nn/parallel/_functions.py:68: UserWarning: Was asked to gather along dimension 0, but all input tensors were scalars; will instead unsqueeze and return a vector.\n warnings.warn('Was asked to gather along dimension 0, but all '\n","output_type":"stream"},{"execution_count":23,"output_type":"execute_result","data":{"text/plain":"TrainOutput(global_step=4221, training_loss=0.8959762511787694, metrics={'train_runtime': 6804.0045, 'train_samples_per_second': 39.683, 'train_steps_per_second': 0.62, 'total_flos': 3.57681111552e+16, 'train_loss': 0.8959762511787694, 'epoch': 3.0})"},"metadata":{}}]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]}]}