Loading...
Loading...
Compare original and translation side by side
transform_dataset_2.ipynb.jsonltransform_dataset_2.ipynb.jsonl../dataset-evaluation/references/strategy_data_requirements.md../dataset-evaluation/references/strategy_data_requirements.mdreferences/sagemaker_dataset_formats.mdreferences/sagemaker_dataset_formats.md"Is this dataset transformation for model training or model evaluation? This helps me look up the right target format for you."
"本次数据集转换是用于模型训练还是模型评估?这会帮助我为你查找正确的目标格式。"
"I can help you transform your dataset's format! Here's my plan: I will first need to understand the format of your dataset and the transformation requirements. Once I have that, I will generate a dataset transformation function that we can refine together. After the dataset transformation function is refined to your liking, I will perform the transformation task and upload it to your desired location! Does this sound good?"
"我可以帮你转换数据集格式!我的计划是:首先我需要了解你的数据集格式和转换需求,确认后我会生成一个数据集转换函数,我们可以一起优化。转换函数调整到你满意后,我会执行转换任务并上传到你需要的位置!你觉得这个方案可以吗?"
"What's the dataset format you would like to transform it into?"
"I've found a SageMaker dataset format: {sagemaker-dataset-format-name} with schema: {sagemaker-dataset-format-schema}. Is this what you were referring to?"
"你希望将数据集转换成什么格式?"
"我找到了SageMaker数据集格式:{sagemaker-dataset-format-name},对应的schema为:{sagemaker-dataset-format-schema}。这是你需要的格式吗?"
"Where can I find your dataset? Either a local directory or S3 location works!"
"我可以在哪里找到你的数据集?本地目录或者S3地址都可以!"
"Where should I output your transformed dataset to? Either a local directory or S3 location works!"
{original_name}_{target_format}.jsonlgen_qa_100k_openai.jsonl"我应该把转换后的数据集输出到哪里?本地目录或者S3地址都可以!"
{original_name}_{target_format}.jsonlgen_qa_100k_openai.jsonlreferences/dataset_transformation_code.mddef transform_dataset(df: pd.DataFrame) -> pd.DataFrame:%%writefile <project-dir>/scripts/transform_fn.py<project-dir>dpo-to-rlvr-conversion<project-dir>/notebooks/<project-dir>/scripts//tmp/test_input.jsonlpython3 -c "import sys; sys.path.insert(0, '<project-dir>/scripts'); from transform_fn import transform_dataset; import pandas as pd; df = pd.read_json('/tmp/test_input.jsonl', lines=True); result = transform_dataset(df); print(result.to_json(orient='records', lines=True))"references/dataset_transformation_code.mddef transform_dataset(df: pd.DataFrame) -> pd.DataFrame:%%writefile <project-dir>/scripts/transform_fn.py<project-dir>dpo-to-rlvr-conversion<project-dir>/notebooks/<project-dir>/scripts//tmp/test_input.jsonlpython3 -c "import sys; sys.path.insert(0, '<project-dir>/scripts'); from transform_fn import transform_dataset; import pandas as pd; df = pd.read_json('/tmp/test_input.jsonl', lines=True); result = transform_dataset(df); print(result.to_json(orient='records', lines=True))"references/notebook_structure.mdreferences/notebook_writing_guide.md%%writefile <project-dir>/scripts/<script_name>.pytransform_datasettransform_fnreferences/dataset_transformation_code.md/tmp/test_input.jsonlpython3 <project-dir>/scripts/<script_name> --input /tmp/test_input.jsonl --output /tmp/test_output.jsonlreferences/notebook_structure.mdreferences/notebook_writing_guide.md%%writefile <project-dir>/scripts/<script_name>.pytransform_fntransform_datasetreferences/dataset_transformation_code.md/tmp/test_input.jsonlpython3 <project-dir>/scripts/<script_name> --input /tmp/test_input.jsonl --output /tmp/test_output.jsonlhead-objectContentLength"Your dataset is {size} MB — since it's under 50 MB, I'd recommend running the transformation locally. Would you like to proceed with local execution, or would you prefer a SageMaker Processing Job instead?"
"Your dataset is {size} MB — since it's over 50 MB, I'd recommend running this as a SageMaker Processing Job for better performance. Would you like to proceed with a SageMaker Processing Job, or would you prefer to run it locally instead?"
.pytransform_datasettransform_fn<project-dir>/scripts/processor.run(wait=True, logs=True)scripts/transformation_tools.py"I've added the execution cell to the notebook. You can run it to transform the full dataset. Would you like to review the notebook before running it?"
head-objectContentLength"你的数据集大小为 {size} MB——由于小于50 MB,我推荐在本地执行转换。你想要继续使用本地执行,还是改用SageMaker Processing Job?"
"你的数据集大小为 {size} MB——由于大于50 MB,为了更好的性能,我推荐作为SageMaker Processing Job运行。你想要继续使用SageMaker Processing Job,还是改用本地运行?"
.pytransform_fntransform_dataset<project-dir>/scripts/processor.run(wait=True, logs=True)scripts/transformation_tools.py"我已经向notebook中添加了执行单元。你可以运行它来转换完整数据集。运行前你想要审核一下notebook吗?"