package cn.iocoder.yudao.module.llm.controller.admin.finetuningtask.vo;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
import com.alibaba.excel.annotation.*;
import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat;
import cn.iocoder.yudao.framework.excel.core.convert.DictConvert;

@Schema(description = "管理后台 - 模型调优 —— 微调任务 Response VO")
@Data
@ExcelIgnoreUnannotated
public class FineTuningTaskRespVO {

    @Schema(description = "任务ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "3218")
    @ExcelProperty("任务ID")
    private Long id;

    @Schema(description = "任务名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "李四")
    @ExcelProperty("任务名称")
    private String taskName;

    @Schema(description = "基础模型，使用字典（llm_base_model）")
    @ExcelProperty(value = "基础模型，使用字典（llm_base_model）", converter = DictConvert.class)
    @DictFormat("llm_base_model") // TODO 代码优化：建议设置到对应的 DictTypeConstants 枚举类中
    private String baseModel;

    @Schema(description = "训练阶段，使用字典（llm_training_stage）")
    @ExcelProperty(value = "训练阶段，使用字典（llm_training_stage）", converter = DictConvert.class)
    @DictFormat("llm_training_stage") // TODO 代码优化：建议设置到对应的 DictTypeConstants 枚举类中
    private Integer trainStage;

    @Schema(description = "微调方法，使用字典（llm_fine_tuning_method）")
    @ExcelProperty(value = "微调方法，使用字典（llm_fine_tuning_method）", converter = DictConvert.class)
    @DictFormat("llm_fine_tuning_method") // TODO 代码优化：建议设置到对应的 DictTypeConstants 枚举类中
    private Integer method;

    @Schema(description = "描述")
    @ExcelProperty("描述")
    private String taskIntro;

    @Schema(description = "GPU类型，使用字典（llm_gpu_type）", example = "1")
    @ExcelProperty(value = "GPU类型，使用字典（llm_gpu_type）", converter = DictConvert.class)
    @DictFormat("llm_gpu_type") // TODO 代码优化：建议设置到对应的 DictTypeConstants 枚举类中
    private Integer gpuType;

    @Schema(description = "GPU数量", example = "7626")
    @ExcelProperty("GPU数量")
    private Integer gpuCount;

    @Schema(description = "数据集ID")
    @ExcelProperty("数据集ID")
    private Long dataset;

    @Schema(description = "学习率")
    @ExcelProperty("学习率")
    private Integer learningRate;

    @Schema(description = "训练轮数")
    @ExcelProperty("训练轮数")
    private Integer epoch;

    @Schema(description = "截断长度")
    @ExcelProperty("截断长度")
    private Integer cutoffLen;

    @Schema(description = "批处理大小")
    @ExcelProperty("批处理大小")
    private Integer batchSize;

    @Schema(description = "梯度累积")
    @ExcelProperty("梯度累积")
    private Integer gradientAccumulation;

    @Schema(description = "预热步数")
    @ExcelProperty("预热步数")
    private Integer warmup;

    @Schema(description = "LoRAy秩")
    @ExcelProperty("LoRAy秩")
    private Integer lorayRank;

    @Schema(description = "LoRAy缩放系数")
    @ExcelProperty("LoRAy缩放系数")
    private Integer lorayScaleFactor;

    @Schema(description = "LoRAy随机丢弃")
    @ExcelProperty("LoRAy随机丢弃")
    private Integer lorayDropout;

    @Schema(description = "LoRAy作用模块")
    @ExcelProperty("LoRAy作用模块")
    private String lorayModule;

    @Schema(description = "DeepSpeed stage，使用字典（llm_deep_speed_stage）")
    @ExcelProperty(value = "DeepSpeed stage，使用字典（llm_deep_speed_stage）", converter = DictConvert.class)
    @DictFormat("llm_deep_speed_stage") // TODO 代码优化：建议设置到对应的 DictTypeConstants 枚举类中
    private String deepSpeedStage;

    @Schema(description = "加速方法，使用字典（llm_acceleration_method）")
    @ExcelProperty(value = "加速方法，使用字典（llm_acceleration_method）", converter = DictConvert.class)
    @DictFormat("llm_acceleration_method") // TODO 代码优化：建议设置到对应的 DictTypeConstants 枚举类中
    private String accelerationMethod;

    @Schema(description = "DeepSpeed offload，使用字典（infra_boolean_string）")
    @ExcelProperty(value = "DeepSpeed offload，使用字典（infra_boolean_string）", converter = DictConvert.class)
    @DictFormat("infra_boolean_string") // TODO 代码优化：建议设置到对应的 DictTypeConstants 枚举类中
    private Boolean deepSpeedOffload;

    @Schema(description = "保存间隔")
    @ExcelProperty("保存间隔")
    private Integer saveInterval;

    @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
    @ExcelProperty("创建时间")
    private LocalDateTime createTime;

    @Schema(description = "更新时间", requiredMode = Schema.RequiredMode.REQUIRED)
    @ExcelProperty("更新时间")
    private LocalDateTime updateTime;

    @Schema(description = "状态，使用字典（llm_fine_tuning_task_status）", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
    @ExcelProperty(value = "状态，使用字典（llm_fine_tuning_task_status）", converter = DictConvert.class)
    @DictFormat("llm_fine_tuning_task_status") // TODO 代码优化：建议设置到对应的 DictTypeConstants 枚举类中
    private Integer status;

}