From 4e5d731fbe4c0936dd2de36fe816655b924e378e Mon Sep 17 00:00:00 2001 From: Ruiyi Wang Date: Tue, 10 Oct 2023 20:02:39 -0400 Subject: [PATCH] close together ai issue --- .../multiturn_data_preprocess.py | 4 +-- together_ai_ft/together_ai_ft.py | 32 ++++++++++++------- 2 files changed, 22 insertions(+), 14 deletions(-) diff --git a/data_process/data/multiturn_data/multiturn_data_preprocess.py b/data_process/data/multiturn_data/multiturn_data_preprocess.py index c9e10dae..64fd3b25 100644 --- a/data_process/data/multiturn_data/multiturn_data_preprocess.py +++ b/data_process/data/multiturn_data/multiturn_data_preprocess.py @@ -68,8 +68,8 @@ def preprocess_data(sotopia_data_dir, file_list, data_type): def split_by_difficulty(sotopia_data_dir): - hard_env_set = set(['01H7VFHNV13MHN97GAH73E3KM8', '01H7VFHN5WVC5HKKVBHZBA553R', '01H7VFHNN7XTR99319DS8KZCQM', '01H7VFHN9W0WAFZCBT09PKJJNK', '01H7VFHPDZVVCDZR3AARA547CY', '01H7VFHPQQQY6H4DNC6NBQ8XTG', '01H7VFHPQQQY6H4DNC6NBQ8XTG', '01H7VFHN7WJK7VWVRZZTQ6DX9T', '01H7VFHN7A1ZX5KSMT2YN9RXC4', '01H7VFHPS5WJW2694R1MNC8JFY', - '01H7VFHPS5WJW2694R1MNC8JFY', '01H7VFHNN7XTR99319DS8KZCQM', '01H7VFHQ11NAMZS4A2RDGDB01V', '01H7VFHQ11NAMZS4A2RDGDB01V', '01H7VFHPSWGDGEYRP63H2DJKV0', '01H7VFHPSWGDGEYRP63H2DJKV0', '01H7VFHNF4G18PC9JHGRC8A1R6', '01H7VFHNNYH3W0VRWVY178K2TK', '01H7VFHP8AN5643B0NR0NP00VE', '01H7VFHN7A1ZX5KSMT2YN9RXC4']) + hard_env_set = set(["01H7VFHNV13MHN97GAH73E3KM8", "01H7VFHN5WVC5HKKVBHZBA553R", "01H7VFHN9W0WAFZCBT09PKJJNK", "01H7VFHPDZVVCDZR3AARA547CY", "01H7VFHPQQQY6H4DNC6NBQ8XTG", "01H7VFHN7WJK7VWVRZZTQ6DX9T", "01H7VFHPS5WJW2694R1MNC8JFY", + "01H7VFHNN7XTR99319DS8KZCQM", "01H7VFHQ11NAMZS4A2RDGDB01V", "01H7VFHPSWGDGEYRP63H2DJKV0", "01H7VFHNF4G18PC9JHGRC8A1R6", "01H7VFHNNYH3W0VRWVY178K2TK", "01H7VFHP8AN5643B0NR0NP00VE", "01H7VFHN7A1ZX5KSMT2YN9RXC4"]) hard_file_list, easy_file_list = [], [] for conv_file in os.listdir(sotopia_data_dir): diff --git a/together_ai_ft/together_ai_ft.py b/together_ai_ft/together_ai_ft.py index 4ad4494e..51febae7 100644 --- a/together_ai_ft/together_ai_ft.py +++ b/together_ai_ft/together_ai_ft.py @@ -1,22 +1,30 @@ import together import os -resp = together.Files.upload(file="together_ai_data.jsonl") -file_id = resp["id"] -files_list = together.Files.list() +together.api_key = "" + +data_path = "/Users/pamela/Documents/capstone/sotopia-ft-data/human-bot-train-gpt4-gpt4-easy-partial.jsonl" +model_type = "togethercomputer/llama-2-13b-chat" + +resp = together.Files.check(file=data_path, model=model_type) +resp = together.Files.upload(file=data_path, model=model_type) +file_id = resp["id"] +# print(file_id) +# files_list = together.Files.list() +# print(files_list['data']) resp = together.Finetune.create( - training_file = files_list['data'][0]['id'], - model = 'togethercomputer/llama-2-7b-chat', - n_epochs = 3, - n_checkpoints = 1, - batch_size = 4, - learning_rate = 1e-5, - suffix = 'test-finetune', - wandb_api_key = '972035264241fb0f6cc3cab51a5d82f47ca713db', + # training_file = files_list['data'][0]['id'], + training_file=file_id, + model=model_type, + n_epochs=1, + n_checkpoints=1, + batch_size=8, + learning_rate=5e-5, + suffix='sotopia-finetune-GPT4+GPT4-clean-tag-1', + wandb_api_key='eca44f65849afa1cc146c22631b0b5001ccd24d7', ) fine_tune_id = resp['id'] print(resp) -