毕设学习进展周报

文章目录

3.11-3.18

1.阅读ACL文献并记录

2.查找相关资料学习在阿里云部署ChatGLM3-6B

参考:https://blog.csdn.net/H66778899/article/details/135630030

python 复制代码
#  运行
streamlit run /mnt/workspace/ChatGLM3/conposite_demo/main.py

可以得到:

3.学习如何微调

首先需对下载的医疗公开数据集进行处理,选择处理的是内科数据集,大概三万多条数据。

用作处理的代码如下,使用智普AI写的:

python 复制代码
import pandas as pd
import json

# 1. 读取CSV文件
import chardet

with open('internal.csv', 'rb') as f:
    result = chardet.detect(f.read())

print(result)  # 输出检测结果,包括编码和置信度

df = pd.read_csv('internal.csv', encoding=result['encoding'])



# 2. 数据预处理
# 这里可以根据需要对数据进行清洗和处
df.drop_duplicates(inplace=True)
df.fillna(method='ffill', inplace=True)

# 3. 格式转换
# 假设您的CSV文件中有两列:"Question" 和 "Answer",您想用它们来训练模型
# 请根据您的实际数据结构调整下面的代码
data_for_chatglm = []
for index, row in df.iterrows():
    data_for_chatglm.append({
        "instruction": row['title'],
        "output": row['answer']
        # 如果需要的话,可以添加更多键值对
    })

# 4. 保存为JSON格式
with open('medical.json', 'w', encoding='utf-8') as f:
    json.dump(data_for_chatglm, f, ensure_ascii=False, indent=4)

数据集的问答存在的问题为:有些回答包含无意义内容,有些回答的语句不通顺,先作为保留问题,等跑通了再做处理

官方微调文档:https://github.com/THUDM/ChatGLM3/blob/main/finetune_demo/README.md

使用阿里云DSW微调ChatGLM3-6B:https://blog.csdn.net/a131529/article/details/134895649

相关推荐
西岸行者1 天前
学习笔记:SKILLS 能帮助更好的vibe coding
笔记·学习
悠哉悠哉愿意1 天前
【单片机学习笔记】串口、超声波、NE555的同时使用
笔记·单片机·学习
别催小唐敲代码1 天前
嵌入式学习路线
学习
毛小茛1 天前
计算机系统概论——校验码
学习
babe小鑫1 天前
大专经济信息管理专业学习数据分析的必要性
学习·数据挖掘·数据分析
winfreedoms1 天前
ROS2知识大白话
笔记·学习·ros2
在这habit之下1 天前
Linux Virtual Server(LVS)学习总结
linux·学习·lvs
我想我不够好。1 天前
2026.2.25监控学习
学习
im_AMBER1 天前
Leetcode 127 删除有序数组中的重复项 | 删除有序数组中的重复项 II
数据结构·学习·算法·leetcode
CodeJourney_J1 天前
从“Hello World“ 开始 C++
c语言·c++·学习