在这里插入图片描述
在这里插入图片描述

# Convert the data to JSON format suitable for fine-tuning
import pandas as pd

# Load the CSV file to inspect its structure
file_path = 'E:/work/fintune/data/test.csv'
data = pd.read_csv(file_path)

# Display the first few rows of the data to understand its structure
data.head()

data_json = [
    {
        "instruction": row['text1'],
        "output": row['text2']
    } for _, row in data.iterrows()
]

# Save the JSON to a file
output_path = 'E:/work/fintune/data/product_descriptions.json'
import json
with open(output_path, 'w', encoding='utf-8') as f:
    json.dump(data_json, f, ensure_ascii=False, indent=4)

# Output the path to the JSON file for further use
output_path

Logo

北京人形旗下天工造物具身智能开源社区,聚焦具身天工与慧思开物两大平台

更多推荐