feat: add sft scripts for Magicoder-Evol-Instruct-110K and alpaca-gpt4-data
- sft_magicoder.py: export ise-uiuc/Magicoder-Evol-Instruct-110K - sft_alpaca_gpt4.py: export llm-wizard/alpaca-gpt4-data with instruction+input - remove deprecated SFT scripts
This commit is contained in:
@@ -1,23 +0,0 @@
|
||||
from datasets import load_dataset
|
||||
from pipeline import export_dataset
|
||||
|
||||
|
||||
def process_func(input_dict: dict):
|
||||
conversations = input_dict["conversations"]
|
||||
n = len(conversations) // 2
|
||||
examples = []
|
||||
for i in range(n):
|
||||
user_msg = conversations[2 * i]["value"]
|
||||
assistant_msg = conversations[2 * i + 1]["value"]
|
||||
examples.append({"query": user_msg, "response": assistant_msg})
|
||||
return examples
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
dataset = load_dataset("BelleGroup/train_3.5M_CN")
|
||||
export_dataset(
|
||||
dataset=dataset["train"],
|
||||
output_dir="./dataset",
|
||||
output_prefix="belle-sft",
|
||||
process_func=process_func,
|
||||
)
|
||||
Reference in New Issue
Block a user