{"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"name":"python","version":"3.12.12","mimetype":"text/x-python","codemirror_mode":{"name":"ipython","version":3},"pygments_lexer":"ipython3","nbconvert_exporter":"python","file_extension":".py"},"kaggle":{"accelerator":"nvidiaTeslaT4","dataSources":[],"isInternetEnabled":true,"language":"python","sourceType":"notebook","isGpuEnabled":true}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"code","source":"from transformers import AutoTokenizer, AutoConfig, AutoModelForSequenceClassification, Trainer, TrainingArguments\nfrom datasets import load_dataset\n\ndataset = load_dataset(\"imdb\")\n\ntokenizer = AutoTokenizer.from_pretrained(\"distilbert-base-uncased\")\n\ndef tokenize_function(examples):\n return tokenizer(examples[\"text\"], padding=\"max_length\", truncation=True, max_length=128)\n\ntokenized_datasets = dataset.map(tokenize_function, batched=True)","metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","trusted":true,"execution":{"iopub.status.busy":"2026-04-05T17:50:50.108565Z","iopub.execute_input":"2026-04-05T17:50:50.108870Z","iopub.status.idle":"2026-04-05T17:52:08.907789Z","shell.execute_reply.started":"2026-04-05T17:50:50.108837Z","shell.execute_reply":"2026-04-05T17:52:08.907028Z"}},"outputs":[{"name":"stderr","text":"Warning: You are sending unauthenticated requests to the HF Hub. Please set a HF_TOKEN to enable higher rate limits and faster downloads.\n","output_type":"stream"},{"output_type":"display_data","data":{"text/plain":"README.md: 0.00B [00:00, ?B/s]","application/vnd.jupyter.widget-view+json":{"version_major":2,"version_minor":0,"model_id":"ce360612141e46aa92852b4f1fcb7048"}},"metadata":{}},{"output_type":"display_data","data":{"text/plain":"plain_text/train-00000-of-00001.parquet: 0%| | 0.00/21.0M [00:00","text/html":"\n
\n \n \n [1955/1955 02:44, Epoch 5/5]\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 Loss
1No log0.859391
21.0562560.820822
30.6299670.873489
40.4935120.938325
50.4935120.979704

"},"metadata":{}},{"output_type":"display_data","data":{"text/plain":"Writing model shards: 0%| | 0/1 [00:00