{ "cells": [ { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "150\n" ] } ], "source": [ "import json\n", "ctrl = json.load(open('./ctrl_toolcall_train_v1.6_ch.json'))+json.load(open('./ctrl_toolcall_train_eng_v1.6_update2.json'))\n", "nav = json.load(open('./nav_toolcall_train_v1.6_ch.json'))+json.load(open('./nav_toolcall_train_eng_v1.6_update2.json'))\n", "multi_ctrl = json.load(open('./multi_toolcall_train_v1.6_ch.json'))+json.load(open('./multi_toolcall_train_eng_v1.6_update2.json'))\n", "from collections import defaultdict\n", "import numpy as np\n", "funcs = defaultdict(set)\n", "normal_seat = set([\"SEAT_ROW_1_LEFT\",\"SEAT_ROW_1_RIGHT\",\"SEAT_ROW_2_LEFT\",\"SEAT_ROW_2_RIGHT\",\"SEAT_ROW_3_LEFT\",\n", "\"SEAT_ROW_3_RIGHT\",\"SEAT_ALL\",\"SEAT_ROW_1\",\"SEAT_ROW_2\",\"SEAT_ROW_3\"])\n", "for tmp in ctrl:\n", " for idx,conv in enumerate(tmp['conversations']):\n", " if conv['from']=='function_call':\n", " tmp_js = json.loads(conv['value'])[0]\n", " try:\n", " if 'areaId' in tmp_js[\"arguments\"] and tmp_js[\"arguments\"]['areaId'] in normal_seat:\n", " tmp_js[\"arguments\"]['areaId']=\"\"\n", " if 'areaId' in tmp_js[\"arguments\"]:\n", " func_type_name = tmp_js[\"arguments\"][\"propertyId\"] if tmp_js[\"arguments\"]['areaId']==\"\" else tmp_js[\"arguments\"][\"propertyId\"]+'%'+tmp_js[\"arguments\"]['areaId']\n", " if 'value' in tmp_js[\"arguments\"] and not str(tmp_js[\"arguments\"]['value']).isdigit():\n", " funcs[func_type_name+'%'+tmp_js[\"arguments\"]['value']].add(tmp['conversations'][idx-1]['value'])\n", " elif 'operation' in tmp_js[\"arguments\"] and tmp_js[\"arguments\"]['operation'] in ['increase','decrease'] and not tmp_js[\"arguments\"][\"propertyId\"] in ['WINDOW_POS']:\n", " funcs[func_type_name+'%'+tmp_js[\"arguments\"]['operation']].add(tmp['conversations'][idx-1]['value'])\n", " elif tmp_js[\"arguments\"][\"propertyId\"] in ['POWER_SUNSHADE','WINDOW_POS']:\n", " func_tmp = func_type_name+\"%\"+tmp_js[\"arguments\"][\"operation\"]\n", " if 'value' in tmp_js[\"arguments\"]:\n", " func_tmp+='%'+str(tmp_js[\"arguments\"]['value'])\n", " funcs[func_tmp].add(tmp['conversations'][idx-1]['value'])\n", " else:\n", " funcs[func_type_name].add(tmp['conversations'][idx-1]['value'])\n", " except:\n", " if tmp_js['name']==\"set_seat_mode\":\n", " funcs[tmp_js['name']+'%'+tmp_js[\"arguments\"][\"value\"]].add(tmp['conversations'][idx-1]['value'])\n", " else:\n", " funcs[tmp_js['name']].add(tmp_js[\"arguments\"][\"query\"])\n", "print(len(funcs))" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "multi_ctrl_case = []\n", "cnt = 0\n", "ctrl_act = 2\n", "np.random.shuffle(multi_ctrl)\n", "for tmp in multi_ctrl:\n", " for idx,conv in enumerate(tmp['conversations']):\n", " if conv['from']=='human':\n", " multi_ctrl_case.append(','.join(conv['value'].split(',')[:ctrl_act]).replace('\"','').replace('Sure! Let me help you with that. ',''))\n", " cnt+=1\n", " if cnt+1%100==0: ctrl_act+=1\n", " if len(multi_ctrl_case)>1500:break" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "ename": "NameError", "evalue": "name 'dfzsad' is not defined", "output_type": "error", "traceback": [ "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", "\u001b[0;31mNameError\u001b[0m Traceback (most recent call last)", "Cell \u001b[0;32mIn[3], line 1\u001b[0m\n\u001b[0;32m----> 1\u001b[0m \u001b[43mdfzsad\u001b[49m\n", "\u001b[0;31mNameError\u001b[0m: name 'dfzsad' is not defined" ] } ], "source": [ "dfzsad" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [], "source": [ "id2label = {i:k for i,k in enumerate(sorted(list(funcs.keys()))+['others','multi_ctrl_cases'])}\n", "label2id = {v: k for k, v in id2label.items()}\n", "dataset = [{'text':t,\"label\":label2id[k]} for k in funcs for t in funcs[k]]\n", "other_case = []\n", "cnt=0\n", "np.random.shuffle(nav)\n", "for tmp in nav:\n", " for idx,conv in enumerate(tmp['conversations']):\n", " if conv['from']=='human':\n", " other_case.append(conv['value'])\n", " cnt+=1\n", " if cnt>800:break\n", "other_case+=['窗戶','窗戶好髒','窗戶有髒汙','陽光灑進窗戶。', '窗外風景優美。', '微風吹拂窗簾。', '雨滴打在窗上。', '窗戶倒影清晰。', '打開窗戶通風。', '車窗外景色飛逝。', '車窗結滿霧氣。', '擦拭乾淨車窗。', '搖下車窗吹風。', '窗內光線柔和。', '窗外喧囂吵雜。', '月光透過窗戶。', '窗戶玻璃反光。', '推開窗戶探頭。', '車窗映出人影。', '窗外一片黑暗。', '凝視窗外發呆。', '窗戶結霜模糊。', '窗外雪花飄落。']\n", "other_case+=['座椅','座位上','座位下','座位','坐在椅子上休息。', '這把椅子很舒適。', '椅子被太陽曬熱。', '這張座椅很寬敞。', '請坐好您的椅子。', '椅子搖晃不穩。', '她拉開了椅子。', '把椅子移過來。', '椅子發出嘎吱聲。', '我坐在辦公椅上。', '這張椅子很重。', '座椅彈性很好。', '請回到您的座位。', '椅子排成一列。', '這張椅子是木製的。', '椅子上鋪著毯子。', '我的座椅很冰冷。', '這張椅子是我的。', '椅子被重新油漆。', '請讓座給老人。']\n", "other_case+=['風向','冷氣','電風扇正在轉動。', '風扇吹來涼風。', '風扇發出噪音。', '冷氣機滴水。', '風扇吹向我。', '冷氣遙控器不見了。', '風扇吹得很舒服。', '冷氣機壞掉了。', '冷氣口對著我。', '冷氣運轉中。', '冷氣口髒了。', '風扇轉速變慢。', '冷氣濾網很髒。', '冷氣需要清洗。', '風扇的風很涼。']\n", "other_case+=['墊高','用書本墊高螢幕。', '用枕頭支撐腰部。', '這根柱子支撐屋頂。', '用木塊墊高桌子。', '這塊海綿很支撐。', '請支撐住這個東西。', '用墊子墊高椅子。', '這個架子很支撐。', '用磚塊墊高。', '用手支撐頭部。', '墊高以利通風。', '用椅子墊高雙腳。', '這個床墊很支撐。', '用支架支撐植物。', '用石頭墊高。', '墊高可以看得更清楚。', '這根棍子是支撐。', '用墊子支撐脖子。', '墊高方便取物。']\n", "other_case+=['生活陷入了循環。', '這個模式很有效。', '打破舊有模式。', '這是個惡性循環。', '建立新的模式。', '每天都在循環。', '這個模式很穩定。', '陷入了疲勞循環。', '學習新的模式。', '這是一種運作模式。', '循環播放音樂。', '這個模式無法更改。', '他習慣了這個模式。', '保持良好循環。', '跳出這個循環。', '找到了新的模式。', '不斷重複的循環。', '這個模式很簡單。']\n", "other_case+=['電動車非常安靜。', '打開除霜功能。', '電動門緩緩開啟。', '除霜後視野清晰。', '這扇窗戶是電動的。', '電動牙刷很方便。', '除霜需要一些時間。', '電動滑板車。', '電動螺絲起子。', '除霜裝置故障。', '電動百葉窗。', '這輛車是電動的。', '啟動電動功能。', '電動吸塵器。', '電動按摩椅。', '除霜按鈕亮了。', '電動自行車。', '除霜效果很好。']\n", "other_case+=['再高一點','再低一點']\n", "other_case+=['fan','air conditioner','AC','sliding door','door','left','right','fuck','window','heat','seat','row','ottoman','second seat','first row']\n", "other_case+=['window','the window is dirty','the window has dirt','Sunlight streams through the window.', 'The scenery outside the window is beautiful.', 'The breeze rustles the curtains.', 'Raindrops hit the window.', 'The window reflection is clear.', 'Open the window for ventilation.', 'The scenery outside the car window flashes past.', 'The car window is completely fogged up.', 'Wipe the car window clean.', 'Roll down the car window for air.', 'The light inside the window is soft.', 'The outside is noisy.', 'Moonlight through the window.', 'The window glass reflects light.', 'Push open the window and peer out.', 'A reflection of a person appears on the car window.', 'Outside the window is completely dark.', 'Gazing blankly out the window.', 'The window is frosted and blurry.', 'Snowflakes are falling outside the window.']\n", "other_case+=['seat','on the seat','under the seat','seating','Sitting on a chair to rest.', 'This chair is very comfortable.', 'The chair was heated by the sun.', 'This seat is very spacious.', 'Please sit properly in your chair.', 'The chair is shaky and unstable.', 'She pulled out the chair.', 'Move the chair over.', 'The chair makes a creaking sound.', 'I sit on an office chair.', 'This chair is very heavy.', 'The seat has good elasticity.', 'Please return to your seat.', 'The chairs are lined up in a row.', 'This chair is made of wood.', 'A blanket is spread on the chair.', 'My seat is very cold.', 'This chair is mine.', 'The chair was repainted.', 'Please offer your seat to an elderly person.']\n", "other_case+=['air direction','air conditioning','The electric fan is turning.', 'The fan is blowing cool air.', 'The fan makes noise.', 'The air conditioner is dripping water.', 'The fan is blowing towards me.', 'The air conditioner remote is missing.', 'The fan is blowing very comfortably.', 'The air conditioner is broken.', 'The air vent is pointed at me.', 'The air conditioner is running.', 'The air vent is dirty.', 'The fan speed slows down.', 'The air conditioner filter is very dirty.', 'The air conditioner needs cleaning.', \"The fan's breeze is very cool.\"]\n", "other_case+=['raise up','Use books to raise the monitor.', 'Use a pillow to support the lower back.', 'This pillar supports the roof.', 'Use wooden blocks to raise the table.', 'This sponge is very supportive.', 'Please support this item.', 'Use a cushion to raise the chair.', 'This shelf is very supportive.', 'Use bricks to raise up.', 'Use your hand to support your head.', 'Raise up for better ventilation.', 'Use a chair to raise your feet.', 'This mattress is very supportive.', 'Use a stand to support the plant.', 'Use stones to raise up.', 'Raising up allows for clearer viewing.', 'This stick is a support.', 'Use a cushion to support the neck.', 'Raise up for easy access to items.']\n", "other_case+=['Life has fallen into a loop.', 'This pattern is very effective.', 'Break the old pattern.', 'This is a vicious cycle.', 'Establish a new pattern.', 'It cycles every day.', 'This pattern is very stable.', 'Fell into a cycle of fatigue.', 'Learn a new pattern.', 'This is a mode of operation.', 'Loop playback of music.', 'This pattern cannot be changed.', 'He is used to this pattern.', 'Maintain a good cycle.', 'Jump out of this cycle.', 'Found a new pattern.', 'A constantly repeating cycle.', 'This pattern is very simple.']\n", "other_case+=['The electric car is very quiet.', 'Turn on the defrost function.', 'The electric door opens slowly.', 'The view is clear after defrosting.', 'This window is electric.', 'Electric toothbrushes are very convenient.', 'Defrosting takes some time.', 'Electric scooter.', 'Electric screwdriver.', 'The defrost device is faulty.', 'Electric blinds.', 'This car is electric.', 'Activate the electric function.', 'Electric vacuum cleaner.', 'Electric massage chair.', 'The defrost button is lit.', 'Electric bicycle.', 'The defrost effect is very good.']\n", "other_case+=['a little higher','Please turn on the second row on','Please turn on','Please provide the original sentence','I can assist you with paraphrasing it in a more fluent manner','Please provide the original sentence so I can assist you with paraphrasing it in a more fluent manner','a little lower','please','Please provide the sentence you would like me to paraphrase.','sentence you would like me to paraphrase.','ask me to paraphrase.']\n", "cnt=0\n", "for tmp in other_case:\n", " dataset.append({'text':tmp,'label':label2id['others']})\n", "for tmp in multi_ctrl_case:\n", " dataset.append({'text':tmp,'label':label2id['multi_ctrl_cases']})\n", "\n", "dataset.append({'text':'關閉車窗並開啟辦公模式','label':label2id['multi_ctrl_cases']})\n", "dataset.append({'text':'開啟空調另外HHTD怎麼報名','label':label2id['multi_ctrl_cases']})\n", "dataset.append({'text':'結束辦公模式','label':label2id[\"set_seat_mode%OFF\"]})\n", "dataset.append({'text':'1排結束辦公模式','label':label2id[\"set_seat_mode%OFF\"]})\n", "dataset.append({'text':'2排結束辦公模式','label':label2id[\"set_seat_mode%OFF\"]})\n", "dataset.append({'text':'3排結束辦公模式','label':label2id[\"set_seat_mode%OFF\"]})\n", "dataset.append({'text':'第3排結束辦公模式','label':label2id[\"set_seat_mode%OFF\"]})\n", "dataset.append({'text':'第2排結束辦公模式','label':label2id[\"set_seat_mode%OFF\"]})\n", "dataset.append({'text':'第1排結束辦公模式','label':label2id[\"set_seat_mode%OFF\"]})\n", "dataset.append({'text':'結束休憩模式','label':label2id[\"set_seat_mode%OFF\"]})\n", "dataset.append({'text':'3排結束休憩模式','label':label2id[\"set_seat_mode%OFF\"]})\n", "dataset.append({'text':'2排結束休憩模式','label':label2id[\"set_seat_mode%OFF\"]})\n", "dataset.append({'text':'1排結束休憩模式','label':label2id[\"set_seat_mode%OFF\"]})\n", "dataset.append({'text':'第1排結束休憩模式','label':label2id[\"set_seat_mode%OFF\"]})\n", "dataset.append({'text':'第2排結束休憩模式','label':label2id[\"set_seat_mode%OFF\"]})\n", "dataset.append({'text':'第3排結束休憩模式','label':label2id[\"set_seat_mode%OFF\"]})\n", "dataset.append({'text':'冷氣不要吹腳','label':label2id[\"HVAC_FAN_DIRECTION%OFF\"]})\n", "dataset.append({'text':'冷氣不要吹頭','label':label2id[\"HVAC_FAN_DIRECTION%OFF\"]})\n", "dataset.append({'text':'冷氣不要吹臉','label':label2id[\"HVAC_FAN_DIRECTION%OFF\"]})\n", "dataset.append({'text':'冷氣不要吹身體','label':label2id[\"HVAC_FAN_DIRECTION%OFF\"]})\n", "dataset.append({'text':'冷氣不要吹','label':label2id[\"HVAC_FAN_DIRECTION%OFF\"]})\n", "dataset.append({'text':'冷氣不要吹我','label':label2id[\"HVAC_FAN_DIRECTION%OFF\"]})\n", "dataset.append({'text':'冷氣出風不要掃風了','label':label2id[\"HVAC_FAN_OUTPUT_MODE%OFF\"]})\n", "dataset.append({'text':'按摩強度開弱','label':label2id[\"SEAT_MASSAGE_INTENSITY%LOW\"]})\n", "dataset.append({'text':'按摩強度開低','label':label2id[\"SEAT_MASSAGE_INTENSITY%LOW\"]})\n", "dataset.append({'text':'按摩強度開中等','label':label2id[\"SEAT_MASSAGE_INTENSITY%MEDIUM\"]})\n", "dataset.append({'text':'打開内循環','label':label2id[\"HVAC_RECIRC_MODE%INTERNAL\"]})\n", "dataset.append({'text':'窗戶關小30 percentage','label':label2id[\"WINDOW_POS%decrease%30\"]})\n", "dataset.append({'text':'溫度有點低','label':label2id[\"HVAC_TEMPERATURE_SET%increase\"]})\n", "dataset.append({'text':'我溫度有點高','label':label2id[\"HVAC_TEMPERATURE_SET%decrease\"]})\n", "dataset.append({'text':'冷氣風太小','label':label2id[\"HVAC_FAN_SPEED%increase\"]})\n", "dataset.append({'text':'風太大吹得不舒服,調小','label':label2id[\"HVAC_FAN_SPEED%decrease\"]})\n", "dataset.append({'text':'steering wheel heater should be turned off.','label':label2id[\"HVAC_STEERING_WHEEL_HEAT%false\"]})\n", "dataset.append({'text':'please adjust the car window to about 90 percent open?','label':label2id[\"WINDOW_POS%set%90\"]})\n", "dataset.append({'text':'Could you please adjust the car window to about 80 percent open?','label':label2id[\"WINDOW_POS%set%80\"]})\n", "dataset.append({'text':'please adjust the window to about 70 percent open?','label':label2id[\"WINDOW_POS%set%70\"]})\n", "dataset.append({'text':'Could you please adjust the car window to about 60 percent open?','label':label2id[\"WINDOW_POS%set%60\"]})\n", "dataset.append({'text':'adjust the window to about 50 percent open?','label':label2id[\"WINDOW_POS%set%50\"]})\n", "dataset.append({'text':'please adjust the window to about 40 percent open?','label':label2id[\"WINDOW_POS%set%40\"]})\n", "dataset.append({'text':'Could you please adjust the car window to about 30 percent open?','label':label2id[\"WINDOW_POS%set%30\"]})\n", "dataset.append({'text':'Could you please adjust the car window to about 20 percent open?','label':label2id[\"WINDOW_POS%set%20\"]})\n", "dataset.append({'text':'please adjust the window to about 10 percent open?','label':label2id[\"WINDOW_POS%set%10\"]})\n", "\n", "dataset.append({'text':'adjust the window to about 90 percent close?','label':label2id[\"WINDOW_POS%set%10\"]})\n", "dataset.append({'text':'Could you please adjust the car window to about 80 percent close?','label':label2id[\"WINDOW_POS%set%20\"]})\n", "dataset.append({'text':'Could you please adjust the window to about 70 percent close?','label':label2id[\"WINDOW_POS%set%30\"]})\n", "dataset.append({'text':'adjust the car window to about 60 percent close?','label':label2id[\"WINDOW_POS%set%40\"]})\n", "dataset.append({'text':'please adjust the window to about 50 percent close?','label':label2id[\"WINDOW_POS%set%50\"]})\n", "dataset.append({'text':'Could you please adjust the car window to about 40 percent close?','label':label2id[\"WINDOW_POS%set%60\"]})\n", "dataset.append({'text':'adjust the car window to about 30 percent close?','label':label2id[\"WINDOW_POS%set%70\"]})\n", "dataset.append({'text':'please adjust the window to about 20 percent close?','label':label2id[\"WINDOW_POS%set%80\"]})\n", "dataset.append({'text':'please adjust the window to about 10 percent close?','label':label2id[\"WINDOW_POS%set%90\"]})\n", "\n", "\n", "useful_dataset = []\n", "for tmp in dataset:\n", " tmp['text'] = tmp['text'].replace(',','').replace('\"','').replace('Sure! Let me help you with that. ','')\n", " if len(tmp['text']) < 5 or 'paraphras' in tmp['text'] or 'rephras' in tmp['text'] or 'sentence' in tmp['text']:continue\n", " useful_dataset.append(tmp)\n", "json.dump(useful_dataset,open('classifier_data.jsonl','w'),indent=2,ensure_ascii=False)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "[2025-10-21 06:09:58,395] [INFO] [real_accelerator.py:219:get_accelerator] Setting ds_accelerator to cuda (auto detect)\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "/usr/bin/ld: cannot find -laio: No such file or directory\n", "collect2: error: ld returned 1 exit status\n", "/usr/bin/ld: cannot find -laio: No such file or directory\n", "collect2: error: ld returned 1 exit status\n" ] } ], "source": [ "\n", "\n", "import torch\n", "from datasets import load_dataset\n", "from transformers import AutoTokenizer, AutoModelForSequenceClassification, TrainingArguments, Trainer\n", "\n", "def train_bert_classifier():\n", " num_labels = len(id2label)\n", " model_name = \"/mnt/jeff/InCar/bert/ModernBERT-base\"\n", " tokenizer = AutoTokenizer.from_pretrained(model_name)\n", " model = AutoModelForSequenceClassification.from_pretrained(\n", " model_name,\n", " num_labels=num_labels,\n", " id2label=id2label,\n", " label2id=label2id\n", " )\n", "\n", " def preprocess_function(examples):\n", " return tokenizer(examples[\"text\"], truncation=True, padding=True)\n", "\n", " print(\"資料前處理中...\")\n", " dataset = load_dataset('json', data_files='classifier_data.jsonl')\n", " tokenized_dataset = dataset.map(preprocess_function, batched=True)\n", "\n", " split_dataset = tokenized_dataset['train'].train_test_split(test_size=0.1)\n", " train_dataset = tokenized_dataset['train']\n", " eval_dataset = split_dataset['test']\n", "\n", " training_args = TrainingArguments(\n", " output_dir=\"./results_classifier3\", # 訓練結果儲存目錄\n", " learning_rate=2e-5, # 學習率\n", " per_device_train_batch_size=8, # 訓練批次大小\n", " per_device_eval_batch_size=8, # 評估批次大小\n", " num_train_epochs=3, # 訓練 epochs 數\n", " weight_decay=0.01, # 權重衰減\n", " save_strategy=\"epoch\", # 每個 epoch 結束後儲存檢查點\n", " report_to='none',\n", " )\n", "\n", " trainer = Trainer(\n", " model=model,\n", " args=training_args,\n", " train_dataset=train_dataset,\n", " eval_dataset=eval_dataset,\n", " tokenizer=tokenizer,\n", " )\n", "\n", " print(\"開始訓練模型...\")\n", " trainer.train()\n", " print(\"模型訓練完成!\")\n", " from tqdm import tqdm\n", " model.eval()\n", " total,corr = 0,0\n", " for i in tqdm(range(len(eval_dataset))):\n", " inputs = tokenizer(eval_dataset[i]['text'], padding=True, truncation=True, return_tensors=\"pt\").to('cuda')\n", " with torch.no_grad():\n", " outputs = model(**inputs)\n", " logits = outputs.logits\n", " predictions = torch.argmax(logits, dim=-1)\n", " res = eval_dataset[i]['label']==predictions.cpu().numpy()[0]\n", " if not res:\n", " if predictions.cpu().numpy()[0] in [num_labels-1,num_labels-2] and eval_dataset[i]['label'] in [num_labels-1,num_labels-2]:continue\n", " print(eval_dataset[i]['text'],eval_dataset[i]['label'],predictions.cpu().numpy()[0],\"lab\",id2label[eval_dataset[i]['label']],'pred',id2label[predictions.cpu().numpy()[0]])\n", " total+=1\n", " corr+=res\n", " print(corr,total,corr/total)\n" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "Some weights of ModernBertForSequenceClassification were not initialized from the model checkpoint at /mnt/jeff/InCar/bert/ModernBERT-base and are newly initialized: ['classifier.bias', 'classifier.weight']\n", "You should probably TRAIN this model on a down-stream task to be able to use it for predictions and inference.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "資料前處理中...\n" ] }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "25703a5df3454fbcbf9a12aead9dc88e", "version_major": 2, "version_minor": 0 }, "text/plain": [ "Generating train split: 0 examples [00:00, ? examples/s]" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "dbf0848a1d48493b9d4464033d9a5b54", "version_major": 2, "version_minor": 0 }, "text/plain": [ "Map: 0%| | 0/77962 [00:00, ? examples/s]" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stderr", "output_type": "stream", "text": [ "/tmp/ipykernel_2497573/2548920613.py:38: FutureWarning: `tokenizer` is deprecated and will be removed in version 5.0.0 for `Trainer.__init__`. Use `processing_class` instead.\n", " trainer = Trainer(\n", "Detected kernel version 4.18.0, which is below the recommended minimum of 5.5.0; this can cause the process to hang. It is recommended to upgrade the kernel to the minimum version or higher.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "開始訓練模型...\n" ] }, { "data": { "text/html": [ "\n", "
| Step | \n", "Training Loss | \n", "
|---|---|
| 500 | \n", "3.443300 | \n", "
| 1000 | \n", "1.308000 | \n", "
| 1500 | \n", "0.635400 | \n", "
| 2000 | \n", "0.438400 | \n", "
| 2500 | \n", "0.325100 | \n", "
| 3000 | \n", "0.283200 | \n", "
| 3500 | \n", "0.257200 | \n", "
| 4000 | \n", "0.229000 | \n", "
| 4500 | \n", "0.235800 | \n", "
| 5000 | \n", "0.168500 | \n", "
| 5500 | \n", "0.204100 | \n", "
| 6000 | \n", "0.172100 | \n", "
| 6500 | \n", "0.160800 | \n", "
| 7000 | \n", "0.163500 | \n", "
| 7500 | \n", "0.179900 | \n", "
| 8000 | \n", "0.149900 | \n", "
| 8500 | \n", "0.170100 | \n", "
| 9000 | \n", "0.148300 | \n", "
| 9500 | \n", "0.146900 | \n", "
| 10000 | \n", "0.129400 | \n", "
| 10500 | \n", "0.103000 | \n", "
| 11000 | \n", "0.098400 | \n", "
| 11500 | \n", "0.117700 | \n", "
| 12000 | \n", "0.099000 | \n", "
| 12500 | \n", "0.115500 | \n", "
| 13000 | \n", "0.123600 | \n", "
| 13500 | \n", "0.120800 | \n", "
| 14000 | \n", "0.106900 | \n", "
| 14500 | \n", "0.098400 | \n", "
| 15000 | \n", "0.073900 | \n", "
| 15500 | \n", "0.106000 | \n", "
| 16000 | \n", "0.095900 | \n", "
| 16500 | \n", "0.107000 | \n", "
| 17000 | \n", "0.108800 | \n", "
| 17500 | \n", "0.108000 | \n", "
| 18000 | \n", "0.094400 | \n", "
| 18500 | \n", "0.094300 | \n", "
| 19000 | \n", "0.086100 | \n", "
| 19500 | \n", "0.094200 | \n", "
| 20000 | \n", "0.059700 | \n", "
| 20500 | \n", "0.061400 | \n", "
| 21000 | \n", "0.070900 | \n", "
| 21500 | \n", "0.055600 | \n", "
| 22000 | \n", "0.049200 | \n", "
| 22500 | \n", "0.047100 | \n", "
| 23000 | \n", "0.062100 | \n", "
| 23500 | \n", "0.058300 | \n", "
| 24000 | \n", "0.038500 | \n", "
| 24500 | \n", "0.063800 | \n", "
| 25000 | \n", "0.052600 | \n", "
| 25500 | \n", "0.058600 | \n", "
| 26000 | \n", "0.053900 | \n", "
| 26500 | \n", "0.050200 | \n", "
| 27000 | \n", "0.054500 | \n", "
| 27500 | \n", "0.037400 | \n", "
| 28000 | \n", "0.046200 | \n", "
| 28500 | \n", "0.048300 | \n", "
| 29000 | \n", "0.045000 | \n", "
"
],
"text/plain": [
"