毕设学习进展周报

文章目录

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

相关推荐
四谎真好看几秒前
JavaWeb学习笔记(Day12)
笔记·学习·学习笔记·javaweb
阿蒙Amon3 分钟前
TypeScript学习-第11章:配置文件(tsconfig.json)
学习·typescript·json
babe小鑫4 分钟前
中专学历转内容运营分析的学习路径
学习·产品运营·内容运营
●VON22 分钟前
React Native for OpenHarmony:贪吃蛇游戏的开发与跨平台适配实践
学习·react native·react.js·游戏·openharmony
妄汐霜2 小时前
小白学习笔记(javaweb前端三大件)
笔记·学习·web
tb_first2 小时前
万字超详细苍穹外卖学习笔记5
java·数据库·spring boot·笔记·学习·spring
Horizon_Ruan2 小时前
从零开始掌握AI:LLM、RAG到Agent的完整学习路线图
人工智能·学习·ai编程
im_AMBER2 小时前
Leetcode 113 合并 K 个升序链表
数据结构·学习·算法·leetcode·链表
rainbow7242442 小时前
系统学习AI的标准化路径,分阶段学习更高效
大数据·人工智能·学习
£漫步 云端彡2 小时前
Golang学习历程【第十三篇 并发入门:goroutine + channel 基础】
开发语言·学习·golang