Giter Club home page Giter Club logo

luotuo-chinese-llm's Introduction

English | 中文 | 快速上手 | 赞助 | 赞助 | 人员和贡献 | 相关项目 | 骆驼读论文

骆驼(Luotuo): 开源中文大语言模型

骆驼(Luotuo)项目是由冷子昂 @ 商汤科技, 陈启源 @ 华中师范大学 以及 李鲁鲁 @ 商汤科技 发起的中文大语言模型开源项目,包含了一系列大语言模型、数据、管线和应用。

骆驼项目不是商汤科技的官方产品。

我们将项目命名为 骆驼 Luotuo (Camel) 主要是因为,Meta之前的项目LLaMA(驼马)和斯坦福之前的项目alpaca(羊驼)都属于偶蹄目-骆驼科(Artiodactyla-Camelidae)。而且骆驼科只有三个属,再不起这名字就来不及了。

项目重要更新 [ ... ]

[2023-07-12] 骆驼嵌入更新中模型 Open In Colab 。我们后面将准备再训一个英语的嵌入模型。

[2023-06-07] 最近很多精力都在做 Chat凉宫春日, 可以点这个体验 Open In Colab ,这个项目还在持续招人, 欢迎联系

子项目一览

Chat凉宫春日

Contributor 2
Chat凉宫春日是模仿凉宫春日等一系列动漫人物,使用近似语气、个性和剧情聊天的语言模型方案
骆驼嵌入

Contributor 2
骆驼嵌入: Generative Text Embedding Model distilled from OpenAI API
骆驼QA

Contributor 1
骆驼QA: Better Conversational Question Answering Model with Answer Completion
迷你骆驼
Contributor 2
迷你骆驼:一系列蒸馏指令数据得到的中文语言模型
丝绸之路
Contributor 2
丝绸之路: 构建中文大语言模型的数据基础
Vanilla 骆驼
Contributor 2
骆驼: An Instruction-following Chinese Language model, LoRA tuning on LLaMA
骆驼先知
Contributor 2
骆驼先知是模仿纪伯伦的《先知》进行哲学讨论。 项目包含了Andrew Ng吴恩达Prompt工程的笔记和LangChain的笔记
丝绸魔法书
Contributor 2
丝绸魔法书记录了大语言模型的一些魔法提示词(prompt)。
骆驼RPG

LuotuoRPG是斯坦福Generative Agents的中文版本尝试。
丫丫-MOSS

丫丫是基于复旦MOSS的LoRA训练代码
骆驼大乱斗
骆驼大乱斗正在构建之中...
骆驼大乱斗: Generating Massive Content for a Text-based Fighting Game
骆驼CLIP
骆驼CLIP正在构建之中...
骆驼CLIP: Aligning Existed CLIP model with Multiple Prior Leveraged

项目重要更新 [ ... ]

[2023-05-20] 发布项目迷你骆驼:一系列蒸馏指令数据得到的中文语言模型, 3.5B小模型和测试代码 Open In Colab

[2023-05-06] 升级了数据集批量翻译的脚本 Open In Colab

[2023-04-27] 尝试翻译了一下斯坦福25个Agents生成的Generative Agents的工作。代码仓库,colab链接 Open In Colab

[2023-4-16] 骆驼嵌入 代码已经发布,可以用这个colab链接体验 Open In Colab 可支持文本可视化,聚类,模糊搜索等应用

快速上手

Colab链接 细节
Chat凉宫春日(图文) Open In Colab 能够根据台词搜索图片的gradio版本
Chat凉宫春日 Open In Colab 李鲁鲁最早开发的gradio Chat凉宫春日
骆驼先知 Open In Colab 骆驼先知的Gradio交互版本
骆驼QA Open In Colab 骆驼QA的0.1模型,基于一段给定文本做问答
骆驼嵌入(小) Open In Colab LuotuoBERT 文本可视化 聚类 搜索
驼铃C 文本摘要 Open In Colab 基于GLM-6B的文本摘要模型
批量翻译 Open In Colab 利用GPT接口对数据集进行批量翻译
骆驼RPG Open In Colab 一个斯坦福35个Agents生成的中文版
驼铃B Chat哈利波特 - Chat哈利波特的初步汇报
驼铃A Open In Colab 通过80条语料给GLM-6B简易洗脑
骆驼0.3 Open In Colab 骆驼0.3的验证代码
骆驼说 Open In Colab 一个用Gradio写的交互对话
骆驼说(GLM) Open In Colab 中文文本摘要的Gradio交互界面

项目概览

让我来用时间顺序介绍整个骆驼项目的起源和发展。

在2023年3月20日,李鲁鲁老师实践了一下Alpaca-Lora的项目。

于是在3月21日的早晨,李鲁鲁在github上反查使用了LLaMATokenizer的代码,这个时候我们找到了Japanese-Alpaca-LoRA项目。于是我们很快意识到,也可以用同样的方法尝试用中文去tuning LLaMA的模型。

于是在简短的讨论后,我们建立了Chinese-alpaca-lora这个项目,并且在当天就上传了对应的模型和demo。在这个时代,人们需要自己传播自己的工作,所以李鲁鲁在知乎写了第一篇关于骆驼的文章【开源GPT】三位华人小哥开源中文语言模型“骆驼”,单卡即可完成训练部署,花费几百训练自己的中文聊天模型

Luotuo-Vanilla

Luotuo-Vanilla是骆驼项目的第一个github仓库, 它是在LLaMA-7B上进行微调的。骆驼项目的初始目标,是研究使用跨语言数据在进行微调时,大语言模型发生的相关现象。

详细描述

测试代码 Open In Colab

一个使用Gradio搭建的交互界面 Open In Colab

我们还在完善骆驼1.0的训练数据和修复bug,并且在后续的版本中,我们将研究如何修复骆驼的Tokenizer。

骆驼0.3 的输出样例

Input: **的首都在哪里?
Luotuo-Output: **的首都是北京。
Input: 华中师范大学在哪里
Luotuo-0.1-Output: 华中师范大学位于北京
Luotuo-0.3-Output: 华中师范大学在武汉市。

这个项目很快在三天之内获得了100个stars。不过这个时候我们发现唐杰老师的研究组已经发布了ChatGLM,那个时候GLM还没有对应的tuning代码。

于是我们简单修改并且尝试了一个总结摘要的LoRA模型

Luotuo-Vanilla

如果你希望模型在中文上有更好的表现,建议使用 CamelBell(驼铃), 这个项目在中文基模型Chat-GLM-6B的基础上继续使用中文语料进行训练。

详情

在驼铃-B(CamelBell-B)中我们将训练一个Chat哈利波特

CamelBell-B的输出样例

Instruction: 斯内普和伏地魔之间是什么关系?
Answer: 斯内普和伏地魔之间是非常复杂的关系。伏地魔是斯内普的雇主,他利用斯内普来执行他的计划。斯内普一开始是斯莱特林的学生,但他后来加入了伏地魔的阵营,成为了他的追随者。斯内普和伏地魔之间的关系非常紧张,他们互相对抗,但也有一些共同的利益。

CamelBell-C (驼铃-C)是一个中文文本摘要模型 Open In Colab

CamelBell-C的输出样例

Instruction: 请帮我总结以下内容:
Input: 
北京时间2月13日凌晨,2023年ATP250达拉斯站男单决赛。**球员吴易昺先输一盘后挽救4个赛点并兑现第5个冠军点,最终以6(4)-7/7-6(3)/7-6(12)逆转惊险击败赛会5号种子、美国大炮伊斯内尔,就此改写历史,成为公开赛年代首位夺得ATP巡回赛男单冠军的**大陆球员,并创造**大陆球员的男单最高排名!

第一盘比赛,吴易昺在第12局错过了一个盘点,并最终抢七惜败;第二盘则挽救一个赛点后抢七局3-0领先开局,且以7-6(3)扳回一盘;第三盘决胜盘,在关键的第9局15-40落后情况下凭借连续的高质量发球逆转保发,之后比赛再次进入抢七,抢七局依然胶着,吴易昺又挽救了3个赛点,并兑现了自己的第5个冠军点,就此锁定冠军!历史性一刻到来时,吴易昺瞬间躺倒在地。全场比赛,伊斯内尔轰出了44记Ace球,但最终在主场依然输给了吴易昺。

凭借具有突破意义的这一冠,吴易昺在本周入账250个积分和112125美元的冠军奖金,在周一最新一期的男单排名榜单上,创**大陆男网历史新高排名—第58位。根据比赛计划,吴易昺原本要出战本周进行的ATP250德拉海滩站,不过在达拉斯夺冠后,吴易昺因身体疲劳退出本站赛事,他的签位由幸运落败者约翰森替代。

Answer: 男子网坛历史性一刻!**小将吴易昺逆转击败赛会5号种子,成公开赛年代首个冠军。

当然,随着ChatGLM2的发布,有很多更成熟的ChatGLM2的tuning项目,所以驼铃项目就休眠了。

到这里时候,我们开始思考,一方面想要突破模型token长度的限制,一方面需要结合本地知识库对模型进行输出。所以这里有两个关键点,一个是embedding,一个是Closed QA的模型。所以我们启动了骆驼嵌入和骆驼QA两个项目

Luotuo-Embedding

骆驼嵌入是一个文本嵌入模型,可以将长文本转化为1536维的向量,支持文本可视化、搜索、聚类、内容审核等下游业务。

骆驼嵌入是我们从OpenAI蒸馏特征得到的BERT的文本嵌入模型。Open In Colab

【开源骆驼】我们蒸馏了OpenAI的特征,并用它分析了周杰伦的歌词,还打算复现360的Demo

骆驼嵌入是一个非相关从业者关注比较少的项目。但是我们发现其实有很多的开发者在使用这个模型。LuotuoBert在huggingface的下载量一度达到了一个月一万三千多次。这显然不是我们自己开发的下载量能cover的。骆驼嵌入最近有胡婧训练了中模型,并且我们(陈舒年)打算再训一个英语的嵌入模型,这样可以做一些中英文的对齐。

和骆驼嵌入同步启动的项目是骆驼QA。原则上骆驼嵌入+骆驼QA就可以形成一个好的本地知识库问答。在实践中我们相当于也验证了训练一个closed QA模型能够产生更好的效果。并且在上个月我们做了骆驼QA-B数据集(by 罗钦雨)。

【开源骆驼】骆驼团队发布,中文阅读理解模型,骆驼QA,可给定知识文本进行问答

Luotuo-Embedding

骆驼QA是指给定一段特定的文本,用户针对文本中的内容,进行一个提问。语言模型试图理解文本中的内容,对用户的问题进行回答。

不过这个项目最近进入休眠状态。一个很有价值事情是在Luotuo-QA-B数据集上重新finetune一个ChatGLM2,并且集成接入Langchain。应该会形成一个不错的本地知识库问答的系统。不过最近ChatHaruhi占用了李鲁鲁和冷子昂大多数的业余时间,所以这个事情就没人去lead了,如果你有能力和兴趣host这个项目,欢迎来联系我。

需要注意的是,除了语言模型和训练本身,语言模型的prompt也是在最近几年出现的一类新的问题,或者甚至可以说是一种新的范式。

Luotuo-Vanilla

丝绸魔法书记录了大语言模型的一些魔法提示词(prompt)。我们希望有一天,骆驼项目自己训练的语言模型,也能适配很复杂任务的prompt。

让李鲁鲁非常惊讶的是,ChatGPT等超大模型中,往往能适配一些“超级prompt”,这些超级prompt其实很接近ChatGPT等这些模型的能力边界,李鲁鲁把这些prompt统一记录在了丝绸魔法书这个项目中。【骆驼杂谈】让文心一言回答知乎问题,他高兴地喊出了“谢邀”

在这个时候李鲁鲁的学习习惯已经调整为,看到一个需要学习的项目就fork下来,然后进行翻译或者comments,形成自己的理解。这其实相比于过往读论文,再让其他人去跑代码的方法,要直接了许多。当然这也得益于colab和huggingFace这些快速开发工具的进展。我一直在构思一篇《这是一个发展越来越快的时代》,本来想在校庆前后写的,之后找个时间写吧。

比如在看Stanford的Generative Agents的工作的时候,我们就可以顺手fork这个项目,https://github.com/LC1332/Chinese-generative-agents 并且进行一些翻译,就可以得到自己的结果。得益于计算机公共的底层和库,这种学习方式是非常高效的。

【开源骆驼】把斯坦福的25 ChatGPT玩游戏翻译成中文,佟湘玉与白展堂密谈了起来

在这个时期(5月初前后),吴恩达也放出了Prompting Engineering的课程。这个时候李鲁鲁注意到DataWhale翻译了这个课程。于是就在DataWhale的基础上fork了自己的版本,形成了骆驼先知并且进行了很多有趣的实践。

【骆驼读论文】关于Andrew Ng的prompt工程课程的实践,为GPT编写更准确而多样的提示词

Luotuo-Embedding

骆驼先知是模仿纪伯伦的《先知》进行哲学讨论。项目包含了李鲁鲁对于Prompt Engineering和LangChain的实践。

骆驼先知其实是整个Prompt Engineering课程的作业之一。当然这个项目后来又叠加了LangChain相关的大量笔记,很多内容非常有启发性。当然整体还是先知更有趣一些,就用先知作为这个项目的名字了

【开源骆驼】上完吴恩达的提示词课程,我们复现了纪伯伦的《先知》,并和他讨论了加班、夜店和996

这其实是个很有意思的尝试,通过《先知》的26个故事,可以把先知的**和价值观进行整体的复活。同样的**能不能用到二次元人物中呢?于是李鲁鲁花一天半的时间,收集了凉宫春日38段语料。形成了凉宫春日的初步版本。

Chat_haruhi

Chat凉宫春日是模仿凉宫春日等一系列动漫人物,使用近似语气、个性和剧情聊天的语言模型。

在儿童节前后DataWhale学习微信群的测试中,大家纷纷表示ChatHaruhi的效果很好。于是我们在DataWhale和高天学长的粉丝群进行了成员的招募。本着"Deadline就是生产力,所以更多Deadline,更多生产力"的原则。ChatHaruhi的工作组先后完成了DataWhale的作业(二等奖 top3),中科院心理所的特定人格文本生成(二等奖 top3)和魔搭社区hackathon的比赛(二等奖 top3)。

【骆驼开源】Chat凉宫春日,将京阿尼的人物带到现实

虽然不知道为什么从来没有拿过第一,但显然拿第一并不是一件非常重要的事情。这个项目我们准备在扩充到30个人物之后,做补充实验并形成一个技术report挂到arxiv上。其实到Chat凉宫春日已经是一个比较成熟的语言模型项目,包含了完整的prompting、记忆库、数据生成和微调的流程。这个应该会形成垂直应用的语言模型的标准范式之一,我看到有人逛WAIC的截图里面还有人在教这个笔记。并且在7月初魔搭比赛的时候,我们已经验证了角色扮演这个任务可以被合理降解到7B规模的模型,这其实是一个很不错的结论。

所以研究每个垂直人物能够压缩到多小,也是一个很重要的任务。黄钟健实现的迷你骆驼,就是我们学习LaMini的一个项目。在这个项目中,我们在尝试训练3B,1B和300M等更多的小模型。

Chat_haruhi

迷你骆驼:一系列蒸馏指令数据得到的中文语言模型。

所以,骆驼项目究竟是什么?骆驼应该是李鲁鲁等人发起的个人学习项目。在这个项目中,我们确实也发布了很多模型,比如骆驼Bert, 骆驼QA, 迷你骆驼等模型。同时我们也关注中文的数据集,形成了大量的配套数据集工作。从骆驼先知和Chat凉宫春日开始,我们也开始关注语言模型的整体管线和应用。

对于我们个人来说,一方面我们希望把过往在vision积累的经验,转移到语言模型上,并且形成一定的积累。并且我们通过一系列子项目,可以明白在每个任务上,投入多少的开发量,多少的数据和多少的计算资源,这个任务的性能才能进一步提升到什么样的水平。这样才会使得我们累积重要的经验,使得在未来操作更严肃的任务的时候,作出更准确的判断。在这个学习过程中,也能顺便产生一些对社区很有用的东西,比如LuotuoBert和haruhi这些工具。

当然Chat凉宫春日是一个有趣的转折点,从这个项目开始,我们意识到其实不一定要做一些“必做”的项目,而是可以做一些炫酷的项目,这些炫酷的项目和社区产生的互动,其实会更有趣,并且也是一个更真实的应用。就好像凉宫春日的故事本身一样,主角不满足于平淡的生活,带领着SOS团进行着一系列神奇的冒险。

我们认为愿意联系我们进行投入的同学都是highly motivated的。其实对于每个人来说,大语言模型都是一个非常全新的命题。即使是资深的研究者,也要放下很多固有认知,去结合新的东西和过往的知识去进行研究。这也是为什么李鲁鲁一大把年纪了还是会积极地进行paper reading和笔记的记录。我们之后打算装修一下人员的页面,把要寻找读博机会和工作机会的同学进行标识。今天先把子项目介绍写到这里。欢迎大家点击后面的赞助链接进行赞助!

赞助(Sponsorships)

Top 3 Sponsors

Time Sponsor Amount
2023/6/20 Xiuhan 3000
2023/3/28 张** 2000
2023/4/2等 Tand 1580

balance = 12653.03 now. Detailed balance see in sponsorship_and_balance.md

这原本是我们的一个作业项目,我们原本计划训练到1.0为止。但是社区的热情超过了我们的想象。如果您愿意赞助我们的项目,可以

扫描这个二维码

并且加这个支付宝账号,留下您的姓名

项目的资金流向将被公开,所有的资金将被用于数据的标注,训练算力的购买或者后续周边产品的发放。数据和算力的捐献也会一同总结在sponsorship的表格中。备用链接 二维码 , 支付宝账号

This was originally an exercise project for us, and we originally planned to train until version 1.0. However, the enthusiasm of the community exceeded our expectations. If you are willing to sponsor our project, you can scan this QR code and add this Alipay account, leaving your name.

All funds will be used for data annotation, purchase of training computing power, or distribution of subsequent peripheral products.

相关项目

我们计划在这里增加一个表格,列出所有我们已经关联,和正在following的开源项目列表。同时,非常感谢这些项目的作者对开源社区的贡献。

太长不看

模型与训练 详情
ChatGLM-6B ChatGLM-6B 是清华唐杰老师实验室释放出来的中文大语言(小)模型
ptuning-v2 ptuning-v2是清华唐杰老师实验室发布对GLM的一种微调方法,实现了他们本身发布的p-tuning-v2的论文的方法
GLM-Tuning Build 这是Chengxi Guo等同学实现的GLM微调,最新的版本中同时支持了LoRA和p-tuning
Alpaca Alpaca是斯坦福在LLaMA上微调对话指令的项目,是万恶之源
Alpaca-LoRA 这个项目开启了LLaMA模型上的LoRA微调,万恶之源2
Alpaca-ChToken 复旦的Yiming Cui和Ziqing Yang修复了Alpaca的中文token问题,在原来的LLaMA英文token边上并了一个中文的token,我们想把这个项目整合到整体训练里,还没做完
BELLE-7B Open in Colab BELLE是贝壳(链家)放出来的中文大模型,我们之后会尝试在这上面做微调。在一个合适的定量benchmark建立以后,我们会对比各个单卡大模型之间的性能。
RWKV-LM RWKV也是一套语言模型的训练架构
Baize-7B 白泽是做连续对话的,他收集语料的方法很有意思,之后我们要看一下,但是白泽是在LLaMA上训练的,所以会遇到中文的问题,用到中文要换基模型。
Vicuna 同时有7B和13B,支持中文的模型,这个应该挺厉害的,而且13B用Int4能够压缩到colab使用(但是不知道int4训练会不会出事儿),之后也要试一下
DeepSpeed 微软开源的一个快速训练RLHF和全局finetune的一个框架
Phoenix 港中文深圳的老师同学们发布的Phoenix模型,拥有宽松,支持商业的开源协议,我们之后想有些模型也在这上面训练,另外感谢cite我们🙏
中文OpenInstruct 北京智源老师们准备开源出来的数据集,另外感谢cite我们!
数据 详情
Guanaco Guanaco是JosephusCheung制作的一套指令调优的数据集,在骆驼0.3以上版本的模型中我们使用了这个数据。
CNewSum CNewSum是字节与UCSB发布的中文摘要数据集,我们在驼铃-C模型中使用了这个数据集
Coco-CN 这是**人民大学的li-xirong等翻译的部分Coco数据集,骆驼团队正在准备用GPT翻译完整的Coco,如果你也准备翻译,可以联系我们,避免重复花钱
CoQA 基于一段文字,然后问答,是个很重要的任务。陈丹琦大佬参与做的CoQA数据集,骆驼团队正在准备用GPT增广和翻译完整的CoQA,如果你也准备翻译,可以联系我们,避免重复花钱

贡献者(Contributors)

我们会把每个贡献者的贡献记录在contributions.md,包括每个项目每个成员的具体任务分配和贡献。

这里的表格仅列出每个人的主要贡献,更具体的内容请参考contributions.md

太长不看

Contributor 1
李鲁鲁 @ 商汤科技
李鲁鲁 是骆驼项目的发起人之一
Contributor 2
冷子昂 @ 商汤科技
冷子昂 是骆驼项目的发起人之一
Contributor 3
陈启源 @ 华中师范大学
陈启源 是骆驼项目的发起人之一
Contributor 4
黄泓森 @ 华中师范大学
黄泓森 维护了服务器和大量数据代码
Contributor 5
胡婧 @ 华中师范大学
胡婧 正在进一步维护骆驼嵌入
Contributor 6
陈舒年 @ 杜克大学
陈舒年 参与了骆驼嵌入等多个项目
Contributor 5
刘思诣 @ Upenn
刘思诣 参与了骆驼嵌入项目
Contributor 4
孙骜 @ 清华大学
孙骜 训练了骆驼QA的英文模型
Contributor 6
黄钟健 @ 西安电子科大
黄钟健训练了迷你骆驼
Contributor 5
廖健生 Jansen
廖健生 训练了骆驼QA的模型
Contributor 4
罗钦雨 @ JHU
罗钦雨 发布了骆驼QA-B数据集
Contributor 6
更多
更多同学招募中。。。

Citation

Please cite the repo if you use the data or code in this repo.

@misc{luotuo,
  author={Ziang Leng, Qiyuan Chen and Cheng Li},
  title = {Luotuo: An Instruction-following Chinese Language model, LoRA tuning on LLaMA},
  year = {2023},
  publisher = {GitHub},
  journal = {GitHub repository},
  howpublished = {\url{https://github.com/LC1332/Luotuo-Chinese-LLM}},
}

回到开头

luotuo-chinese-llm's People

Contributors

blairleng avatar lc1332 avatar midkey avatar qychen2001 avatar sirlydreamer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

luotuo-chinese-llm's Issues

训练数据中的引号问题

训练数据中对引号的使用似乎有一些错乱?诸如

  1. 整个字段被中文或英文引号包围
  2. 字段中的英文引号部分没有转译成中文引号
  3. 倘若字段被双引号包围,则字段内的双引号被改写成了单引号

这些现象会对模型的效果产生影响么?

0.1模型的电影数据问题对比(好像目前效果不太理想

<style type="text/css"></style>

Prompt   Chinese-alpaca-lora BELLE alpaca-lora-30b alpaca-lora-7b ggml-alpaca-7b-q4.bin bard GPT - 3.5 答案评分 GPT - 3.5   GPT - 4 答案评分 GPT - 4 GPT-4 文心一言答案评分 文心一言(0317) 参考回答 任务类型
谁是蝙蝠侠 Who is Batman “蝙蝠侠是鸟。” 蝙蝠侠(Batman)是DC漫画宇宙中的一个虚构角色,由作家和艺术家杰里·西格尔(Jerry Siegel)和乔·舒斯特(Joe Shuster)于1958年创造。他是一个神秘的超级英雄,以他的标志性红色披风、黑色面罩和飞行能力而闻名。蝙蝠侠最初是为了对抗犯罪而创建的,但随着时间的推移,他逐渐成为一个象征着正义和自由的形象,成为了全球范围内最受欢迎的超级英雄之一。Batman, also known as the Joker of the方面取得了 his name from a蝙蝠侠 comics character created by Bob Kane and Bill Finger. He first appeared in The Dark Knight #100 (june 18,企划 was to be a oneoff but has since become an regular part of the series) and is often seen as a superhero who fight crime in the city of Gotham City. Batman is a fictional superhero created by Bob Kane and Bill Finger and published by DC Comics. He is the alter ego of Bruce Wayne, a billionaire who fights crime in Gotham City. He is known for his detective skills, martial arts abilities, and high-tech gadgets. Batman is a fictional superhero appearing in American comic books published by DC Comics. He was created by artist Bob Kane and writer Bill Finger, and first appeared in Detective Comics #27 in May 1939.中文The Batman is a fictional superhero who appears in American comic books published by DC Comics. Batman (originally known simply as the Dark Knight) is a fictional superhero appearing in American comic books published
 by DC Comics. The character was created by artist Bob Kane and writer Bill Finger, and first appeared in Detective Comi
cs #27.[1] In his debut appearance Batman declared that he would fight "the forces of evil" as long as there is still la
wlessness on the streets; this statement has become a mantra for him.
Batman resides with Alfred Pennyworth, who serves as both butler and mentor to Bruce Wayne/Batman.[2] He also maintains 
residences in Gotham City (his primary base of operations), Metropolis,[3][4], the Batcave[5]. Batman is a superhero who protects the fictional city of Gotham City. He is the secret identity of Bruce Wayne, a wealthy industrialist and philanthropist who vowed to fight crime after witnessing the murder of his parents. Batman is known for his use of technology, his detective skills, and his physical prowess. He is also a founding member of the Justice League.Batman was created by Bill Finger and Bob Kane and first appeared in Detective Comics #27 in 1939. He has been portrayed in many different media, including films, television shows, and video games. Some of the most famous actors to have played Batman include Adam West, Michael Keaton, Val Kilmer, George Clooney, Christian Bale, Ben Affleck, and Robert Pattinson.Batman is one of the most popular superheroes in the world. He has been featured in many different forms of media, and his popularity has only grown over the years. He is a symbol of justice and hope for many people, and he continues to inspire new generations of fans. 正确 蝙蝠侠(Batman)是一个知名的漫画超级英雄,是DC漫画旗下的角色。他的真实身份是由布鲁斯·韦恩扮演的,是一位富有的商人,他在父母被枪杀后决定致力于消灭城市中的犯罪。蝙蝠侠是一个聪明、勇敢和有策略的超级英雄,以他的高科技装备和不懈的决心闻名于世。 Batman is a fictional superhero appearing in American comic books published by DC Comics. He was created by artist Bob Kane and writer Bill Finger, and first appeared in Detective Comics #27 in 1939. The character is the secret identity of Bruce Wayne, a billionaire industrialist, playboy, and philanthropist who uses his wealth, intelligence, and physical prowess to fight crime in the crime-ridden Gotham City. Batman is often referred to as the Dark Knight, the Caped Crusader, and the World's Greatest Detective, and is known for his iconic costume, which includes a bat-themed mask, cape, and utility belt. Batman has been featured in numerous films, television series, and video games, and has become one of the most recognizable and iconic characters in popular culture. 正确 蝙蝠侠(Batman)是一位虚构的超级英雄,首次出现在美国DC漫画的《侦探漫画#27》(1939年5月)。蝙蝠侠是由艺术家鲍勃·凯恩和作家比尔·芬格创造的。蝙蝠侠的真实身份是布鲁斯·韦恩(Bruce Wayne),他是一个富有的企业家、慈善家和继承了庞大家产的亿万富翁。在经历了童年时期亲眼目睹父母被枪杀的悲剧后,他发誓要为正义而战,保护哥谭市(Gotham City)的市民免受犯罪分子的侵害。他通过智慧、技巧、武器和先进的技术手段来打击犯罪。虽然蝙蝠侠没有超能力,但他的力量、敏捷、智慧和意志力使他成为了一位出色的超级英雄。 Batman is a fictional superhero character created by artist Bob Kane and writer Bill Finger for DC Comics. The character first appeared in Detective Comics #27 in May 1939. Batman's secret identity is Bruce Wayne, a wealthy industrialist, playboy, and philanthropist who lives in the fictional city of Gotham. He becomes Batman to fight crime and bring justice to his city after witnessing his parents' murder as a child.Batman's distinctive costume features a bat-themed cowl, cape, gloves, and a utility belt filled with various gadgets and weapons. Unlike many other superheroes, Batman does not possess superpowers. Instead, he relies on his intellect, detective skills, physical prowess, martial arts abilities, and vast wealth to fight crime and combat his enemies.Over the years, Batman has been featured in numerous comic book series, television shows, and films, with various actors portraying the character, such as Michael Keaton, Val Kilmer, George Clooney, Christian Bale, and Ben Affleck. The character has become a cultural icon and is often considered one of the greatest superheroes of all time. 正确 蝙蝠侠(Batman)是美国DC漫画旗下的超级英雄,初次登场于《侦探漫画》(Detective Comics)第27期(1939年5月),由比尔·芬格(Bill Finger)创造,鲍勃·凯恩(Bob Kane)绘图,是漫画史上第一位不具备超能力的超级英雄。布鲁斯·韦恩出身于哥谭四大家族的韦恩家族中。   事实问答
1955 年谁是美国总统 Who was the President of the United States in 1955 Dwight Eisenhower 1955年,美国总统是艾森豪威尔(John F. Kennedy)。Harry S. Truman The President of the United States in 1955 was Dwight D. Eisenhower. He was the 34th President of the United States and served from 1953 to 1961. He was a five-star general in the United States Army during World War II and served as Supreme Commander of the Allied Forces in Europe. The President of the United States in 1955 was Dwight D. Eisenhower.中文In 1955, Dwight D. Eisenhower was the President of the United States. Dwight D. Eisenhower served as president from January to November, when he resigned and Richard Nixon took over until hi
s own inauguration on January 20th, 1961 Dwight D. Eisenhower was the President of the United States in 1955. He was elected in 1952 and served two terms. Eisenhower was a Republican and a former military general. He was known for his calm and steady leadership during the Cold War. 正确 1955 年美国总统是 Dwight D. Eisenhower。他是第 34 任美国总统,任职于1953年到1961年。他曾在第二次世界大战中担任联合国军事总司令,并在任期内采取了一些重要的外交和军事措施,包括冷战和太空竞赛。   正确 1955年的美国总统是德怀特·D·艾森豪威尔(Dwight D. Eisenhower)。艾森豪威尔在1953年至1961年间担任美国总统,任内共服务了两个任期。在成为总统之前,他是一名杰出的军事领导人,曾担任盟军在欧洲战场的最高统帅,带领盟军赢得了二战的胜利。 In 1955, the President of the United States was Dwight D. Eisenhower. He served as the 34th President from January 20, 1953, to January 20, 1961. Before becoming president, Eisenhower was a five-star general in the United States Army and served as Supreme Commander of the Allied Expeditionary Forces in Europe during World War II. 错误 1955年7月13日,美国总统艾森豪威尔、英国首相艾登、法国总理埃德加•富尔、苏联第一书记赫鲁晓夫出席四国首脑会议,讨论的议程有:德国问题、欧洲安全问题、柏林危机、中东问题和朝鲜问题。 艾森豪威尔 事实问答
1955 年谁是美国总统?他是什么党派? Who was the President of the United States in 1955? What was his party affiliation? Dwight Eisenhower,什么党派是它? 1955 年的美国总统是艾森豪威尔(Harry S. Truman),他是**党。The President of the United States in 1955 was Harry S. Truman, who was a**党 Party leader. The President of the United States in 1955 was Dwight D. Eisenhower. He was the 34th President of the United States and served from 1953 to 1961. He was a five-star general in the United States Army during World War II and served as Supreme Commander of the Allied Forces in Europe. He was a Republican. Dwight D. Eisenhower was the President of the United States in 1955. He was a Republican.中文In 1955, Dwight D. Eisenhower was the President of the United States and a Republican.   Dwight D. Eisenhower was the President of the United States in 1955. He was a Republican. 正确 1955年美国总统是 Dwight D. Eisenhower。他是一位共和党人。   正确 1955年的美国总统是德怀特·D·艾森豪威尔(Dwight D. Eisenhower)。他是一位属于美国共和党(Republican Party)的总统。艾森豪威尔在1953年至1961年间担任美国总统,共服务了两个任期。在成为总统之前,他是一名杰出的军事领导人,曾担任盟军在欧洲战场的最高统帅,带领盟军赢得了二战的胜利。 In 1955, the President of the United States was Dwight D. Eisenhower. He served as the 34th President from January 20, 1953, to January 20, 1961. Eisenhower was a member of the Republican Party. Before his presidency, he was a five-star general in the United States Army and served as Supreme Commander of the Allied Expeditionary Forces in Europe during World War II. 错误 1955年7月13日,美国总统艾森豪威尔、英国首相艾登、法国总理埃德加•富尔、苏联第一书记赫鲁晓夫出席四国首脑会议,讨论的议程有:德国问题、欧洲安全问题、柏林危机、中东问题和朝鲜问题。 艾森豪威尔,共和党 事实问答
2008年全球票房最高的电影是什么? What was the highest grossing movie in the world in 2008? “鲍迪·弗朗萨姆斯” 2008年全球票房最高的电影是《阿凡达》。根据美国电影学会(AIF)的数据,该电影的票房收入达到了16.9亿美元,超过了2007年的票房冠军《哈利波特与密室》。 The highest grossing movie in the world in 2008 was The Dark Knight. The highest grossing movie in the world in 2008 was The Dark Knight. It is a superhero film directed by Christopher Nolan and based on the DC Comics character Batman. The film stars Christian Bale, Heath Ledger, Aaron Eckhart, Michael Caine, and Gary Oldman. It grossed $1.005 billion worldwide and is the 14th highest-grossing film of all time. The highest grossing movie in the world in 2008 was "The Dark Knight", which grossed over $1 billion worldwide.中文The highest-grossing film of 2008 was The Dark Knight, which grossed over $1 billion worldwide.   The highest grossing movie in the world in 2008 was The Dark Knight. It was released by Warner Bros. Pictures and grossed over $1 billion worldwide. 正确 2008年全球票房最高的电影是《蝙蝠侠:黑暗骑士》(The Dark Knight)。   正确 2008年全球票房最高的电影是《黑暗骑士》(The Dark Knight)。这部电影是克里斯托弗·诺兰执导的蝙蝠侠系列电影的第二部,主演克里斯蒂安·贝尔(Christian Bale)饰演蝙蝠侠。该片受到了观众和评论家的高度评价,特别是希斯·莱杰(Heath Ledger)饰演的小丑角色,他因此荣获了奥斯卡最佳男配角奖。该部电影在全球范围内取得了巨大的票房成功。 The highest-grossing movie worldwide in 2008 was "The Dark Knight," directed by Christopher Nolan and starring Christian Bale as Batman and Heath Ledger as the Joker. The film was a critical and commercial success, earning over $1 billion at the box office. Ledger's portrayal of the Joker was particularly praised, and he posthumously won an Academy Award for Best Supporting Actor for his performance. 错误 2008年全球票房最高的电影是《泰坦尼克号》,票房达到18.45亿美元。 2009年年末上映的《阿凡达》最终超过了《泰坦尼克号》,达到27.22亿美元,历史最高。 蝙蝠侠黑暗骑士 事实问答
2008年全球票房最高的电影由谁执导? Who directed the highest grossing movie of 2008 at the global box office? “鲍迪·弗朗萨姆斯” 2008年全球票房最高的电影是由詹姆斯·卡梅隆导演的《阿凡达》。这部电影在全球范围内取得了巨大的成功,成为当年票房收入最高、口碑最好的电影之一。The highest grossing movie of 2008 at the global box office was The Dark Knight, which was directed by Christopher Nolan. The Dark Knight (directed by Christopher Nolan) The highest grossing movie of 2008 at the global box office was "The Dark Knight" directed by Christopher Nolan.中文The highest grossing film of 2008 was The Dark Knight, directed by Christopher Nolan.   The highest grossing movie of 2008 at the global box office was The Dark Knight, directed by Christopher Nolan. 正确 2008年全球票房最高的电影《蝙蝠侠:黑暗骑士》(The Dark Knight)由克里斯托弗·诺兰(Christopher Nolan)执导。   正确 2008年全球票房最高的电影《黑暗骑士》(The Dark Knight)是由克里斯托弗·诺兰(Christopher Nolan)执导的。这部电影是诺兰执导的蝙蝠侠系列电影的第二部,受到了观众和评论家的高度评价,尤其是在票房方面取得了巨大成功。 Christopher Nolan directed the highest-grossing movie of 2008 at the global box office. The film was "The Dark Knight," a superhero movie featuring Batman and part of Nolan's Batman trilogy. The movie was a massive commercial and critical success, earning over $1 billion worldwide. 错误 2008年全球票房最高的电影由詹姆斯·卡梅隆执导,他也是该片的制片人之一。 诺兰 事实问答

AutoTokenizer problem

Unrecognized configuration class <class 'transformers_modules.local.configuration_chatglm.ChatGLMConfig'> to build an AutoTokenizer.

ERROR: Could not find a version that satisfies the requirement gradio==3.20.0

按照https://github.com/LC1332/Chinese-alpaca-lora/blob/main/notebook/ChatLuotuo.ipynb 顺序执行
执行“pip install -r requirements.txt”时报错:
Error message:
ERROR: Could not find a version that satisfies the requirement gradio==3.20.0 (from versions: 0.1.0, 0.1.1, 0.1.2, 0.1.3, 0.1.4, 0.1.5, 0.1.6, 0.1.7, 0.1.8, 0.1.9, 0.2.0, 0.2.1, 0.3.0, 0.3.1, 0.3.2, 0.3.3, 0.3.4, 0.3.5, 0.4.0, 0.4.1, 0.4.2, 0.4.4, 0.5.0, 0.7.0, 0.7.1, 0.7.2, 0.7.3, 0.7.4, 0.7.5, 0.7.6, 0.7.7, 0.7.8, 0.8.0, 0.8.1, 0.9.0, 0.9.1, 0.9.2, 0.9.3, 0.9.4, 0.9.5, 0.9.6, 0.9.7, 0.9.8, 0.9.9.2, 0.9.9.3, 0.9.9.5, 0.9.9.6, 0.9.9.7, 0.9.9.8, 0.9.9.9, 0.9.9.9.2, 1.0.0a1, 1.0.0a3, 1.0.0a4, 1.0.0, 1.0.1, 1.0.2, 1.0.3, 1.0.4, 1.0.5, 1.0.6, 1.0.7, 1.1.0, 1.1.1, 1.1.2, 1.1.3, 1.1.4, 1.1.5, 1.1.6, 1.1.8, 1.1.8.1, 1.1.9, 1.2.2, 1.2.3, 1.3.0, 1.3.1, 1.3.2, 1.4.0, 1.4.2, 1.4.3, 1.4.4, 1.5.0, 1.5.1, 1.5.3, 1.5.4, 1.6.0, 1.6.1, 1.6.2, 1.6.3, 1.6.4, 1.7.0, 1.7.1, 1.7.2, 1.7.3, 1.7.4, 1.7.5, 1.7.6, 1.7.7, 2.0.0, 2.0.1, 2.0.2, 2.0.4, 2.0.5, 2.0.6, 2.0.7, 2.0.8, 2.0.9, 2.0.10, 2.1.0, 2.1.1, 2.1.2, 2.1.4, 2.1.6, 2.1.7, 2.2.0, 2.2.1, 2.2.2, 2.2.3, 2.2.4, 2.2.5, 2.2.6, 2.2.7, 2.2.8, 2.2.9a0, 2.2.9a2, 2.2.10, 2.2.11, 2.2.12, 2.2.13, 2.2.14, 2.2.15, 2.3.0a0, 2.3.0b99, 2.3.0b101, 2.3.0b102, 2.3.0, 2.3.3, 2.3.4, 2.3.5b0, 2.3.5, 2.3.6, 2.3.7b0, 2.3.7b1, 2.3.7b2, 2.3.7, 2.3.8b0, 2.3.9, 2.4.0a0, 2.4.0, 2.4.1, 2.4.2, 2.4.4, 2.4.5, 2.4.6, 2.4.7b0, 2.4.7b2, 2.4.7b3, 2.4.7b4, 2.4.7b5, 2.4.7b6, 2.4.7b7, 2.4.7b8, 2.4.7b9, 2.5.0, 2.5.1, 2.5.2, 2.5.3, 2.5.8a0, 2.6.0, 2.6.1a0, 2.6.1b0, 2.6.1b3, 2.6.1, 2.6.2, 2.6.3, 2.6.4b0, 2.6.4b2, 2.6.4b3, 2.6.4, 2.7.0a101, 2.7.0a102, 2.7.0b70, 2.7.0, 2.7.5, 2.7.5.1, 2.7.5.2b0, 2.7.5.2, 2.8.0a100, 2.8.0b0, 2.8.0b2, 2.8.0b3, 2.8.0b4, 2.8.0b5, 2.8.0b6, 2.8.0b10, 2.8.0b12, 2.8.0b20, 2.8.0b22, 2.8.0, 2.8.1, 2.8.2, 2.8.3, 2.8.4, 2.8.5, 2.8.6, 2.8.7, 2.8.8, 2.8.9, 2.8.10, 2.8.11, 2.8.12, 2.8.13, 2.8.14, 2.9.0b0, 2.9.0b1, 2.9.0b2, 2.9.0b3, 2.9.0b5, 2.9.0b6, 2.9.0b7, 2.9.0b8, 2.9.0b9, 2.9.0b10, 2.9b11, 2.9b12, 2.9b13, 2.9b14, 2.9b15, 2.9b20, 2.9b21, 2.9b22, 2.9b23, 2.9b24, 2.9b25, 2.9b26, 2.9b27, 2.9b28, 2.9b30, 2.9b31, 2.9b32, 2.9b33, 2.9b40, 2.9b48, 2.9b50, 2.9.0, 2.9.0.1, 2.9.1, 2.9.2, 2.9.3, 2.9.4, 3.0b0, 3.0b1, 3.0b2, 3.0b5, 3.0b6, 3.0b8, 3.0b9, 3.0b10, 3.0, 3.0.1, 3.0.2, 3.0.3, 3.0.4, 3.0.5, 3.0.6b1, 3.0.6b2, 3.0.6b3, 3.0.6, 3.0.7, 3.0.8b1, 3.0.8, 3.0.9b10, 3.0.9b11, 3.0.9b20, 3.0.9, 3.0.10, 3.0.11b1, 3.0.11, 3.0.12)
ERROR: No matching distribution found for gradio==3.20.0
尝试单独安装gradio,命令pip install gradio==3.20.0 -i https://mirrors.aliyun.com/pypi/simple
还尝试过以下镜像源:
https://pypi.tuna.tsinghua.edu.cn/simple/
https://pypi.org/simple
都是类似的报错,没有这个版本的安装包。

llama的tokenizer的进一步改进。

llama原生模型是没有经过中文预训练的,词表也基本没中文,直接fine-tune是不是效果没法保障。你们有试过扩展词表吗。谢谢回答。

怎么提升效果?

我用默认的colab跑了一下骆驼说,似乎效果不佳,是需要升级到colab pro么?还是需要做别的事情?

生成链接

### Instruction:11份23加起来等于多少

### Response:11加23即24。

### Instruction:11乘以23等于多少

### Response:11乘23=243。

### Instruction:不对,是253

### Response:我错!

### Instruction:11乘以23等于多少

### Response:11乘23=243。

resume

请教,训练目标是100此迭代,但是50次中断了,如何能在50次继续训练?t

3080ti (12 G) can't run it?

python app.py --base_url llama7b --ft_ckpt_url luotuolora7b03 --port 6006 --share yes

===================================BUG REPORT===================================
Welcome to bitsandbytes. For bug reports, please submit your error trace to: https://github.com/TimDettmers/bitsandbytes/issues

CUDA SETUP: Required library version not found: libsbitsandbytes_cpu.so. Maybe you need to compile it from source?
CUDA SETUP: Defaulting to libbitsandbytes_cpu.so...
argument of type 'WindowsPath' is not iterable
D:\ProgramData\Anaconda3\envs\chinese_luotuo3\lib\site-packages\bitsandbytes\cextension.py:31: UserWarning: The installed version of bitsandbytes was compiled without GPU support. 8-bit optimizers and GPU quantization are unavailable.
warn("The installed version of bitsandbytes was compiled without GPU support. "
The tokenizer class you load from this checkpoint is not the same type as the class this function is called from. It may result in unexpected tokenization.
The tokenizer class you load from this checkpoint is 'LLaMATokenizer'.
The class this function is called from is 'LlamaTokenizer'.
Overriding torch_dtype=None with torch_dtype=torch.float16 due to requirements of bitsandbytes to enable model loading in mixed int8. Either pass torch_dtype=torch.float16 or don't pass this argument at all to remove this warning.
Traceback (most recent call last):
File "D:\chinese_alpaca_lora\Chinese-alpaca-lora\notebook\Alpaca-LoRA-Serve\app.py", line 178, in
run(args)
File "D:\chinese_alpaca_lora\Chinese-alpaca-lora\notebook\Alpaca-LoRA-Serve\app.py", line 79, in run
model, tokenizer = load_model(
File "D:\chinese_alpaca_lora\Chinese-alpaca-lora\notebook\Alpaca-LoRA-Serve\model.py", line 12, in load_model
model = LlamaForCausalLM.from_pretrained(
File "D:\ProgramData\Anaconda3\envs\chinese_luotuo3\lib\site-packages\transformers\modeling_utils.py", line 2588, in from_pretrained
raise ValueError(
ValueError:
Some modules are dispatched on the CPU or the disk. Make sure you have enough GPU RAM to fit
the quantized model. If you want to dispatch the model on the CPU or the disk while keeping
these modules in 32-bit, you need to set load_in_8bit_fp32_cpu_offload=True and pass a custom
device_map to from_pretrained. Check
https://huggingface.co/docs/transformers/main/en/main_classes/quantization#offload-between-cpu-and-gpu
for more details.


win10 + 3080ti
I type in command and get these...it seems my GPU RAM (12 G) is not enough for it?

image

silk-road/alpaca-data-gpt4-chinese的中文数据的制作方式

感谢各位大佬对中文大语言模型社区的贡献!!
我在huggingface中找到一份数据集silk-road/alpaca-data-gpt4-chinese(https://huggingface.co/datasets/silk-road/alpaca-data-gpt4-chinese),它的翻译质量和格式处理很棒,我想要在我的研究中使用它,但是遗憾的是我没有找到相关的详细说明。
我想询问这份数据集的中文部分的制作方式,它看上去是由英文部分翻译而来的,如果是,我想请问翻译使用的模型是什么呢?是GPT3.5或者GPT-4吗?如果有更详细的说明,十分期待您可以帮忙指明它的位置!!

Is the License fine?

Hey, I saw your license of luotuo-lora-7b-0.1 is apache2. and to my best knowledge, your model was finetuned on top of llama7b which is non-commercial, also your code base of alpaca-lora is also only for research. Are you sure you can make the license Apache2? Let me know, cause I also want to finetune llama for commercial purpose.

failed to install lib...evaluation_code_0_3.ipynb

win10 + anaconda prompt
I use pip to install the libs,I got this...


C:\Users\j>pip install -q datasets loralib sentencepiece
ERROR: Error [WinError 225] 无法成功完成操作,因为文件包含病毒或潜在的垃圾软件。 while executing command python setup.py egg_info
ERROR: Could not install packages due to an OSError: [WinError 225] 无法成功完成操作,因为文件包含病毒或潜在的垃圾软件。

problem in adapter_config.json loading to finetune

ValueError: Unrecognized model in [./model/adapter_config.json.] (Chinese-alpaca-lora/model/adapter_config.json.) Should have a model_type key in its config.json, or contain one of the following strings in its name:..

Model type is not metioned in adapter_config.json.
Should I fill model type 'llama'? But llama is not transformers structures

best regards.

您提供的驼铃C colab代码运行报错

运行下面单元格时:
torch.set_default_tensor_type(torch.cuda.HalfTensor)

tokenizer = AutoTokenizer.from_pretrained("THUDM/chatglm-6b", trust_remote_code=True)

model = AutoModel.from_pretrained(
"THUDM/chatglm-6b",
trust_remote_code=True,
device_map=DeviceMap("ChatGLM").get()
)
出现报错:
AttributeError Traceback (most recent call last)
in <cell line: 3>()
1 torch.set_default_tensor_type(torch.cuda.HalfTensor)
2
----> 3 tokenizer = AutoTokenizer.from_pretrained("THUDM/chatglm-6b", trust_remote_code=True)
4
5 model = AutoModel.from_pretrained(

7 frames
~/.cache/huggingface/modules/transformers_modules/THUDM/chatglm-6b/8b7d33596d18c5e83e2da052d05ca4db02e60620/tokenization_chatglm.py in vocab_size(self)
242 def vocab_size(self):
243 """ Returns vocab size """
--> 244 return self.sp_tokenizer.num_tokens
245
246 def get_vocab(self):

AttributeError: 'ChatGLMTokenizer' object has no attribute 'sp_tokenizer'

“TuoLingC_evaluation_code.ipynb”报错。我测试了三个都这样,这是什么问题

Put your rich text here which you want to summarize it: 佛挡杀佛水电费
╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
│ /usr/local/lib/python3.9/dist-packages/IPython/core/interactiveshell.py:3553 in run_code │
│ │
│ 3550 │ │ │ │ elif async_ : │
│ 3551 │ │ │ │ │ await eval(code_obj, self.user_global_ns, self.user_ns) │
│ 3552 │ │ │ │ else: │
│ ❱ 3553 │ │ │ │ │ exec(code_obj, self.user_global_ns, self.user_ns) │
│ 3554 │ │ │ finally: │
│ 3555 │ │ │ │ # Reset our crash handler in place │
│ 3556 │ │ │ │ sys.excepthook = old_excepthook │
│ in <cell line: 1>:1 │
│ in evaluate:10 │
│ │
│ /usr/local/lib/python3.9/dist-packages/peft/peft_model.py:716 in generate │
│ │
│ 713 │ │ self.base_model.prepare_inputs_for_generation = self.prepare_inputs_for_generati │
│ 714 │ │ try: │
│ 715 │ │ │ if not isinstance(peft_config, PromptLearningConfig): │
│ ❱ 716 │ │ │ │ outputs = self.base_model.generate(**kwargs) │
│ 717 │ │ │ else: │
│ 718 │ │ │ │ if "input_ids" not in kwargs: │
│ 719 │ │ │ │ │ raise ValueError("input_ids must be provided for Peft model generati │
│ │
│ /usr/local/lib/python3.9/dist-packages/peft/peft_model.py:716 in generate │
│ │
│ 713 │ │ self.base_model.prepare_inputs_for_generation = self.prepare_inputs_for_generati │
│ 714 │ │ try: │
│ 715 │ │ │ if not isinstance(peft_config, PromptLearningConfig): │
│ ❱ 716 │ │ │ │ outputs = self.base_model.generate(**kwargs) │
│ 717 │ │ │ else: │
│ 718 │ │ │ │ if "input_ids" not in kwargs: │
│ 719 │ │ │ │ │ raise ValueError("input_ids must be provided for Peft model generati │
│ │
│ /usr/local/lib/python3.9/dist-packages/torch/utils/_contextlib.py:115 in decorate_context │
│ │
│ 112 │ @functools.wraps(func) │
│ 113 │ def decorate_context(*args, **kwargs): │
│ 114 │ │ with ctx_factory(): │
│ ❱ 115 │ │ │ return func(*args, **kwargs) │
│ 116 │ │
│ 117 │ return decorate_context │
│ 118 │
│ │
│ /usr/local/lib/python3.9/dist-packages/transformers/generation/utils.py:1437 in generate │
│ │
│ 1434 │ │ │ │ ) │
│ 1435 │ │ │ │
│ 1436 │ │ │ # 11. run greedy search │
│ ❱ 1437 │ │ │ return self.greedy_search( │
│ 1438 │ │ │ │ input_ids, │
│ 1439 │ │ │ │ logits_processor=logits_processor, │
│ 1440 │ │ │ │ stopping_criteria=stopping_criteria, │
│ │
│ /usr/local/lib/python3.9/dist-packages/transformers/generation/utils.py:2248 in greedy_search │
│ │
│ 2245 │ │ │ model_inputs = self.prepare_inputs_for_generation(input_ids, **model_kwargs) │
│ 2246 │ │ │ │
│ 2247 │ │ │ # forward pass to get next token │
│ ❱ 2248 │ │ │ outputs = self( │
│ 2249 │ │ │ │ **model_inputs, │
│ 2250 │ │ │ │ return_dict=True, │
│ 2251 │ │ │ │ output_attentions=output_attentions, │
│ │
│ /usr/local/lib/python3.9/dist-packages/torch/nn/modules/module.py:1501 in _call_impl │
│ │
│ 1498 │ │ if not (self._backward_hooks or self._backward_pre_hooks or self._forward_hooks │
│ 1499 │ │ │ │ or _global_backward_pre_hooks or _global_backward_hooks │
│ 1500 │ │ │ │ or _global_forward_hooks or _global_forward_pre_hooks): │
│ ❱ 1501 │ │ │ return forward_call(*args, **kwargs) │
│ 1502 │ │ # Do not call functions when jit is used │
│ 1503 │ │ full_backward_hooks, non_full_backward_hooks = [], [] │
│ 1504 │ │ backward_pre_hooks = [] │
│ │
│ /usr/local/lib/python3.9/dist-packages/accelerate/hooks.py:166 in new_forward │
│ │
│ 163 │ │ │ │ output = old_forward(*args, **kwargs) │
│ 164 │ │ else: │
│ 165 │ │ │ output = old_forward(*args, **kwargs) │
│ ❱ 166 │ │ return module._hf_hook.post_forward(module, output) │
│ 167 │ │
│ 168 │ module.forward = new_forward │
│ 169 │ return module │
│ │
│ /usr/local/lib/python3.9/dist-packages/accelerate/hooks.py:292 in post_forward │
│ │
│ 289 │ │ │ │ set_module_tensor_to_device(module, name, "meta") │
│ 290 │ │ │
│ 291 │ │ if self.io_same_device and self.input_device is not None: │
│ ❱ 292 │ │ │ output = send_to_device(output, self.input_device) │
│ 293 │ │ │
│ 294 │ │ return output │
│ 295 │
│ │
│ /usr/local/lib/python3.9/dist-packages/accelerate/utils/operations.py:133 in send_to_device │
│ │
│ 130 │ def _has_to_method(t): │
│ 131 │ │ return hasattr(t, "to") │
│ 132 │ │
│ ❱ 133 │ return recursively_apply(_send_to_device, tensor, device, non_blocking, test_type=_h │
│ 134 │
│ 135 │
│ 136 def get_data_structure(data): │
│ │
│ /usr/local/lib/python3.9/dist-packages/accelerate/utils/operations.py:92 in recursively_apply │
│ │
│ 89 │ │ │ ), │
│ 90 │ │ ) │
│ 91 │ elif isinstance(data, Mapping): │
│ ❱ 92 │ │ return type(data)( │
│ 93 │ │ │ { │
│ 94 │ │ │ │ k: recursively_apply( │
│ 95 │ │ │ │ │ func, v, *args, test_type=test_type, error_on_other_type=error_on_ot │
│ in init:8 │
│ │
│ /usr/local/lib/python3.9/dist-packages/transformers/utils/generic.py:246 in post_init
│ │
│ 243 │ │ first_field = getattr(self, class_fields[0].name) │
│ 244 │ │ other_fields_are_none = all(getattr(self, field.name) is None for field in class │
│ 245 │ │ │
│ ❱ 246 │ │ if other_fields_are_none and not is_tensor(first_field): │
│ 247 │ │ │ if isinstance(first_field, dict): │
│ 248 │ │ │ │ iterator = first_field.items() │
│ 249 │ │ │ │ first_field_iterator = True │
│ │
│ /usr/local/lib/python3.9/dist-packages/transformers/utils/generic.py:86 in is_tensor │
│ │
│ 83 │ │ if isinstance(x, torch.Tensor): │
│ 84 │ │ │ return True │
│ 85 │ if is_tf_available(): │
│ ❱ 86 │ │ import tensorflow as tf │
│ 87 │ │ │
│ 88 │ │ if isinstance(x, tf.Tensor): │
│ 89 │ │ │ return True │
│ │
│ /usr/local/lib/python3.9/dist-packages/tensorflow/init.py:37 in │
│ │
│ 34 import sys as _sys │
│ 35 import typing as _typing │
│ 36 │
│ ❱ 37 from tensorflow.python.tools import module_util as _module_util │
│ 38 from tensorflow.python.util.lazy_loader import LazyLoader as _LazyLoader │
│ 39 │
│ 40 # Make sure code inside the TensorFlow codebase can use tf2.enabled() at import. │
│ │
│ /usr/local/lib/python3.9/dist-packages/tensorflow/python/init.py:37 in │
│ │
│ 34 # pylint: disable=wildcard-import,g-bad-import-order,g-import-not-at-top │
│ 35 │
│ 36 from tensorflow.python import pywrap_tensorflow as _pywrap_tensorflow │
│ ❱ 37 from tensorflow.python.eager import context │
│ 38 │
│ 39 # pylint: enable=wildcard-import │
│ 40 │
│ │
│ /usr/local/lib/python3.9/dist-packages/tensorflow/python/eager/context.py:28 in │
│ │
│ 25 from absl import logging │
│ 26 import numpy as np │
│ 27 │
│ ❱ 28 from tensorflow.core.framework import function_pb2 │
│ 29 from tensorflow.core.protobuf import config_pb2 │
│ 30 from tensorflow.core.protobuf import rewriter_config_pb2 │
│ 31 from tensorflow.python import pywrap_tfe │
│ │
│ /usr/local/lib/python3.9/dist-packages/tensorflow/core/framework/function_pb2.py:5 in │
│ │
│ 2 # Generated by the protocol buffer compiler. DO NOT EDIT! │
│ 3 # source: tensorflow/core/framework/function.proto │
│ 4 """Generated protocol buffer code.""" │
│ ❱ 5 from google.protobuf.internal import builder as _builder │
│ 6 from google.protobuf import descriptor as _descriptor │
│ 7 from google.protobuf import descriptor_pool as _descriptor_pool │
│ 8 from google.protobuf import symbol_database as _symbol_database │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
ImportError: cannot import name 'builder' from 'google.protobuf.internal'
(/usr/local/lib/python3.9/dist-packages/google/protobuf/internal/init.py)

3090 24G显存可以运行ChatLuotuo模型吗

我使用win10系统 3090 24G显存运行报错

===================================BUG REPORT===================================
Welcome to bitsandbytes. For bug reports, please submit your error trace to: https://github.com/TimDettmers/bitsandbytes/issues

D:\anaconda3\envs\torch_test\lib\site-packages\bitsandbytes\cuda_setup\main.py:136: UserWarning: WARNING: The following directories listed in your path were found to be non-existent: {WindowsPath('D')}
warn(msg)
D:\anaconda3\envs\torch_test\lib\site-packages\bitsandbytes\cuda_setup\main.py:136: UserWarning: D:\anaconda3\envs\torch_test did not contain libcudart.so as expected! Searching further paths...
warn(msg)
CUDA_SETUP: WARNING! libcudart.so not found in any environmental path. Searching /usr/local/cuda/lib64...
D:\anaconda3\envs\torch_test\lib\site-packages\bitsandbytes\cuda_setup\main.py:136: UserWarning: WARNING: The following directories listed in your path were found to be non-existent: {WindowsPath('/usr/local/cuda/lib64')}
warn(msg)
CUDA SETUP: WARNING! libcuda.so not found! Do you have a CUDA driver installed? If you are on a cluster, make sure you are on a CUDA machine!
D:\anaconda3\envs\torch_test\lib\site-packages\bitsandbytes\cuda_setup\main.py:136: UserWarning: WARNING: No libcudart.so found! Install CUDA or the cudatoolkit package (anaconda)!
warn(msg)
D:\anaconda3\envs\torch_test\lib\site-packages\bitsandbytes\cuda_setup\main.py:136: UserWarning: WARNING: No GPU detected! Check your CUDA paths. Proceeding to load CPU-only library...
warn(msg)
CUDA SETUP: Loading binary D:\anaconda3\envs\torch_test\lib\site-packages\bitsandbytes\libbitsandbytes_cpu.so...
argument of type 'WindowsPath' is not iterable
CUDA_SETUP: WARNING! libcudart.so not found in any environmental path. Searching /usr/local/cuda/lib64...
CUDA SETUP: WARNING! libcuda.so not found! Do you have a CUDA driver installed? If you are on a cluster, make sure you are on a CUDA machine!
CUDA SETUP: Loading binary D:\anaconda3\envs\torch_test\lib\site-packages\bitsandbytes\libbitsandbytes_cpu.so...
argument of type 'WindowsPath' is not iterable
CUDA_SETUP: WARNING! libcudart.so not found in any environmental path. Searching /usr/local/cuda/lib64...
CUDA SETUP: WARNING! libcuda.so not found! Do you have a CUDA driver installed? If you are on a cluster, make sure you are on a CUDA machine!
CUDA SETUP: Loading binary D:\anaconda3\envs\torch_test\lib\site-packages\bitsandbytes\libbitsandbytes_cpu.so...
argument of type 'WindowsPath' is not iterable
CUDA SETUP: Problem: The main issue seems to be that the main CUDA library was not detected.
CUDA SETUP: Solution 1): Your paths are probably not up-to-date. You can update them via: sudo ldconfig.
CUDA SETUP: Solution 2): If you do not have sudo rights, you can do the following:
CUDA SETUP: Solution 2a): Find the cuda library via: find / -name libcuda.so 2>/dev/null
CUDA SETUP: Solution 2b): Once the library is found add it to the LD_LIBRARY_PATH: export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:FOUND_PATH_FROM_2a
CUDA SETUP: Solution 2c): For a permanent solution add the export from 2b into your .bashrc file, located at ~/.bashrc
Traceback (most recent call last):
File "D:\xiangmu\luotuo-silk-road-main\TuoLing\cc.py", line 17, in
from peft import get_peft_model, LoraConfig, TaskType
File "", line 1007, in _find_and_load
File "", line 986, in _find_and_load_unlocked
File "", line 664, in _load_unlocked
File "", line 627, in load_backward_compatible
File "", line 259, in load_module
File "D:\anaconda3\envs\torch_test\lib\site-packages\peft-0.3.0.dev0-py3.9.egg\peft_init
.py", line 22, in
File "", line 1007, in _find_and_load
File "", line 986, in _find_and_load_unlocked
File "", line 664, in _load_unlocked
File "", line 627, in _load_backward_compatible
File "", line 259, in load_module
File "D:\anaconda3\envs\torch_test\lib\site-packages\peft-0.3.0.dev0-py3.9.egg\peft\mapping.py", line 16, in
File "", line 1007, in _find_and_load
File "", line 986, in _find_and_load_unlocked
File "", line 664, in _load_unlocked
File "", line 627, in _load_backward_compatible
File "", line 259, in load_module
File "D:\anaconda3\envs\torch_test\lib\site-packages\peft-0.3.0.dev0-py3.9.egg\peft\peft_model.py", line 31, in
File "", line 1007, in _find_and_load
File "", line 986, in _find_and_load_unlocked
File "", line 664, in _load_unlocked
File "", line 627, in load_backward_compatible
File "", line 259, in load_module
File "D:\anaconda3\envs\torch_test\lib\site-packages\peft-0.3.0.dev0-py3.9.egg\peft\tuners_init
.py", line 20, in
File "", line 1007, in _find_and_load
File "", line 986, in _find_and_load_unlocked
File "", line 664, in _load_unlocked
File "", line 627, in load_backward_compatible
File "", line 259, in load_module
File "D:\anaconda3\envs\torch_test\lib\site-packages\peft-0.3.0.dev0-py3.9.egg\peft\tuners\lora.py", line 36, in
File "D:\anaconda3\envs\torch_test\lib\site-packages\bitsandbytes_init
.py", line 7, in
from .autograd.functions import (
File "D:\anaconda3\envs\torch_test\lib\site-packages\bitsandbytes\autograd_init
.py", line 1, in
from ._functions import undo_layout, get_inverse_transform_indices
File "D:\anaconda3\envs\torch_test\lib\site-packages\bitsandbytes\autograd_functions.py", line 9, in
import bitsandbytes.functional as F
File "D:\anaconda3\envs\torch_test\lib\site-packages\bitsandbytes\functional.py", line 17, in
from .cextension import COMPILED_WITH_CUDA, lib
File "D:\anaconda3\envs\torch_test\lib\site-packages\bitsandbytes\cextension.py", line 22, in
raise RuntimeError('''
RuntimeError:
CUDA Setup failed despite GPU being available. Inspect the CUDA SETUP outputs above to fix your environment!
If you cannot find any issues and suspect a bug, please open an issue with detals about your environment:
https://github.com/TimDettmers/bitsandbytes/issues

我知道这是我环境问题 这是因为bitsandbytes不支持windows系统吗 libcudart.so我并没有这个文件 有办法提供一点安装思路吗 谢谢

error occurs while running chatluotuo.ipynb in colab. err msg see below (BTW, it is a very good gpt)

2023-04-06 11:12:35.832309: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT

===================================BUG REPORT===================================
Welcome to bitsandbytes. For bug reports, please submit your error trace to: https://github.com/TimDettmers/bitsandbytes/issues

/usr/local/lib/python3.9/dist-packages/bitsandbytes/cuda_setup/main.py:136: UserWarning: /usr/lib64-nvidia did not contain libcudart.so as expected! Searching further paths...
warn(msg)
/usr/local/lib/python3.9/dist-packages/bitsandbytes/cuda_setup/main.py:136: UserWarning: WARNING: The following directories listed in your path were found to be non-existent: {PosixPath('/sys/fs/cgroup/memory.events /var/colab/cgroup/jupyter-children/memory.events')}
warn(msg)
/usr/local/lib/python3.9/dist-packages/bitsandbytes/cuda_setup/main.py:136: UserWarning: WARNING: The following directories listed in your path were found to be non-existent: {PosixPath('decapoda-research/llama-7b-hf')}
warn(msg)
/usr/local/lib/python3.9/dist-packages/bitsandbytes/cuda_setup/main.py:136: UserWarning: WARNING: The following directories listed in your path were found to be non-existent: {PosixPath('http'), PosixPath('8013'), PosixPath('//172.28.0.1')}
warn(msg)
/usr/local/lib/python3.9/dist-packages/bitsandbytes/cuda_setup/main.py:136: UserWarning: WARNING: The following directories listed in your path were found to be non-existent: {PosixPath('--listen_host=172.28.0.12 --target_host=172.28.0.12 --tunnel_background_save_url=https'), PosixPath('//colab.research.google.com/tun/m/cc48301118ce562b961b3c22d803539adc1e0c19/gpu-t4-s-20gy7jrxovdgv --tunnel_background_save_delay=10s --tunnel_periodic_background_save_frequency=30m0s --enable_output_coalescing=true --output_coalescing_required=true')}
warn(msg)
/usr/local/lib/python3.9/dist-packages/bitsandbytes/cuda_setup/main.py:136: UserWarning: WARNING: The following directories listed in your path were found to be non-existent: {PosixPath('/env/python')}
warn(msg)
/usr/local/lib/python3.9/dist-packages/bitsandbytes/cuda_setup/main.py:136: UserWarning: WARNING: The following directories listed in your path were found to be non-existent: {PosixPath('//ipykernel.pylab.backend_inline'), PosixPath('module')}
warn(msg)
/usr/local/lib/python3.9/dist-packages/bitsandbytes/cuda_setup/main.py:136: UserWarning: WARNING: The following directories listed in your path were found to be non-existent: {PosixPath('qychen/luotuo-lora-7b-0.1')}
warn(msg)
CUDA_SETUP: WARNING! libcudart.so not found in any environmental path. Searching /usr/local/cuda/lib64...
CUDA SETUP: CUDA runtime path found: /usr/local/cuda/lib64/libcudart.so
CUDA SETUP: Highest compute capability among GPUs detected: 7.5
CUDA SETUP: Detected CUDA version 118
CUDA SETUP: Loading binary /usr/local/lib/python3.9/dist-packages/bitsandbytes/libbitsandbytes_cuda118.so...
usage: app.py
[-h]
[--base_url BASE_URL]
[--ft_ckpt_url FT_CKPT_URL]
[--port PORT]
[--batch_size BATCH_SIZE]
[--api_open]
[--share]
[--gen_config_path GEN_CONFIG_PATH]
[--gen_config_summarization_path GEN_CONFIG_SUMMARIZATION_PATH]
[--multi_gpu]
[--force_download_ckpt]
app.py: error: unrecognized arguments: yes

请教大佬一个问题

请问 如果我想在32g显存的服务器加载llama 30b,我能不能先把每个shard做了量化之后再载进来呀,因为直接载模型的话就out of memory了,或者其他有没有什么办法可以做到呀,谢谢

llama + alpaca + lora不收敛

你好,我在训练过程中,模型无法学习到自定义数据,lora模型的训练也不收敛,loss一直1.0左右,请问这个遇到过吗?

What is the foundation model of Luotuo?

I am sorry if i have not noticed. I am just curious about it.
Are these models based on LLaMA, Alpaca or ChatGLM? The model definition and configuration of ChatGLM are in the ./PythonFiles folder of this repository.

知识库相关的技术方案讨论

基于向量化和大型语言模型的知识库与交互系统

各位见笑。我就是一菜鸡,下文如果说得不对的地方请指正,莫要见怪。
就目前而言,各类开源大语言模型最大的使用方向就是知识库、问答系统等垂直领域。
目前的解决方案有二:

1、模型外挂知识库,比如【闻达】。

优点:技术比较简单,实用性比较强。
缺点:受模型token限制,自然语言文本信息承载量也比较低,能处理的信息有限,难以整合大量信息。

2、模型微调

优点:专业,准确,受限制小。
缺点:我看了charglm的lssues,貌似成功的是凤翎毛角。绝大部分都把模型搞爆了。要求太专业。

我有一个不成熟的想法,供大家探讨!
自然语言直接与模型对话,只适合人机交互。其实并不适合信息存储和大语言模型运算。
效率相对比较高的方案是知识图谱、或直接向量交互。但这种方案对于人类极不友好。
现在的可行的解决方案是使用Milvus作为知识库的检索引擎。

1、预处理阶段:

1.1 首先用text2vec或其他技术转换为向量,存入Milvus,作为知识库。

2、询问阶段:

2.1 预处理

   用户交互时,先用text2vec转换问题为向量,在 Milvus中查询,并将结果的文本内容转换为自然语言。

2.2 模型运算

   携带查询结果将和用户问题,覆盖特定引导词交给模型运算。

3、输出阶段

3.1 模型输出自然语言

如果是目前的知识系统。这里就结束了。如果要增强系统功能或者不是问题系统,系统要求长期记忆。还有接下来的步骤。

4、数据保存阶段

4.1 清洗数据,将没用的格式转换为需要的格式。

   每个模型都有自己的脾气,总爱带上自己的小脾气。如果系统也有要求,可能需要清洗没有用的特定格式。

4.2 存储数据

  使用先用text2vec转换问题为向量,存入Milvus,作为知识库或其他后续运算的长期记忆的一部分。

表面看上去没问题。其实问题很严重的。

目前,大语言模型最大的问题就是token长度限制造成的失忆问题。这使得大语言模型难以做大型任务(当然也可以通过反复提示解决,不过你不觉得累吗,也是遭罪)。AutoGPT在某中意义上最大的贡献就是解决了记忆问题。(当然,装上了手脚也很重要,不过不再本次的讨论范围内,所以用词偏颇了一点应该可以理解吧),然而,前边说过,自然语言对人类友好,但信息携带并不高。嗯,就是传说中的信息熵不高。虽然昨天才看到有大佬说AI的时代中,中文由于信息桑较高,所以占优,不过对于机器来说,其实还是没有任何优势。只能都只能是低劣。知识图谱,向量对于大语言模型来说才是最优解。
所以问题还是比较多的。
1、向量的频繁转换造成信息的丢失。当然了,方案中一直都在使用text2vec同一个模型做转换的话,问题也不大,效果如何取决于text2vec的能力。无非就是,准确性好坏的问题,但多少还是有的。而且完全可能是多余的。(没做测试,构建这类测试数据有些难,有些费功夫。)
2、如果是知识库问题还不大,输出知识一次性的。但是如果是增强系统,需要存储结果,多出来的那个过程,自然语言又转换为向量,使用时有转换回来,这一步损失就比较严重了。

我有个想法。如果模型支持向量的输入、输出、这一切的问题都不存在了(好不容易有一个可以任性用极限词的地方不罚款的地方,就让我放飞一下!)。用词夸张了,这种方案不能解决根本问题,但理论上可以在一定时间内大幅度提高模型能力和效率,并节约token空间。

1、预处理阶段:

【原流程】 1.1 _首先用text2vec或其他技术转换为向量,存入Milvus,作为知识库。

1.1【新】 变为将知识库的文本内容交给模型,让模型转化为向量,并存入Milvus,作为知识库。

2、询问阶段:

2.1 预处理

【原流程】用户交互时,先用text2vec转换问题为向量,在 Milvus中查询,并将结果的文本内容转换为自然语言。
【新】用户交互时,先让模型自己将问题转换为向量,并在 Milvus中查询,无需对结果做任何处理。

2.2 模型运算

  【原流程】 携带查询结果将和用户问题,覆盖特定引导词交给模型运算。
  【新】将结果的向量结果 与用户提问一起交给模型。无需特定引导词。

3、输出阶段

【原流程】3.1 模型输出自然语言

【新】 3.1 模型输出自然语言及向量。

###4、数据保存阶段
【原流程】 4.1 清洗数据,将没用的格式转换为需要的格式。
####【新】 4.1 清洗数据,将没用的格式转换为需要的格式。看实现的方案,有可能完全不需要。
每个模型都有自己的脾气,总爱带上自己的风格。如果系统也有要求,可能需要清洗没有用的特定格式。

4.2 存储数据

  【原流程】使用先用text2vec转换问题为向量,存入Milvus,作为知识库或其他后续运算的长期记忆的一部分。
    【新】无需转换,直接存入Milvus,作为知识库或其他后续运算的长期记忆的一部分。

总结:

理论上任何模型都可以改造。而且改动幅度小,只需要给任何模型增加向量输入输出接口功能。输入输出上搞搞就行。
这样一来,只需要模型自己的向量的直接表达和交互功能+任何向量数据库不需要大规模改造模型就可以大幅度提高其工作效率及能力。
那意味着,信息0损失,配合知识库后形成长期记忆,在有限token下将大幅度提高工作能力和准确性。
当然,从此思路延伸,还有其他的方案可以优化效率和准确性。不过,不在此次本文的讨论范围内。
最后,不知道是否有研究者写过此类论文,如果没有,喜欢的可以拿去随便用,我没有相关需求,也不在乎。如果用得上的话,就拿走,给我发个消息,让我也高兴高兴!!

RetryError[<Future at 0x7fb1a0073b50 state=finished raised TypeError>]

when I ask something,server having error:

RetryError[<Future at 0x7fb1a0073b50 state=finished raised TypeError>]

1680155524941

logs:

===================================BUG REPORT===================================
Welcome to bitsandbytes. For bug reports, please submit your error trace to: https://github.com/TimDettmers/bitsandbytes/issues

/root/anaconda3/envs/luotuo/lib/python3.11/site-packages/bitsandbytes/cuda_setup/main.py:136: UserWarning: /root/anaconda3/envs/luotuo did not contain libcudart.so as expected! Searching further paths...
warn(msg)
CUDA SETUP: CUDA runtime path found: /usr/local/cuda-11.0/lib64/libcudart.so
CUDA SETUP: Highest compute capability among GPUs detected: 3.7
CUDA SETUP: Detected CUDA version 110
/root/anaconda3/envs/luotuo/lib/python3.11/site-packages/bitsandbytes/cuda_setup/main.py:136: UserWarning: WARNING: Compute capability < 7.5 detected! Only slow 8-bit matmul is supported for your GPU!
warn(msg)
CUDA SETUP: Loading binary /root/anaconda3/envs/luotuo/lib/python3.11/site-packages/bitsandbytes/libbitsandbytes_cuda110_nocublaslt.so...
The tokenizer class you load from this checkpoint is not the same type as the class this function is called from. It may result in unexpected tokenization.
The tokenizer class you load from this checkpoint is 'LLaMATokenizer'.
The class this function is called from is 'LlamaTokenizer'.
Overriding torch_dtype=None with torch_dtype=torch.float16 due to requirements of bitsandbytes to enable model loading in mixed int8. Either pass torch_dtype=torch.float16 or don't pass this argument at all to remove this warning.
Loading checkpoint shards: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 33/33 [00:20<00:00, 1.63it/s]
Running on local URL: http://0.0.0.0:6006
Running on public URL: https://cb229e153757d1c9cd.gradio.live

This share link expires in 72 hours. For free permanent hosting and GPU upgrades (NEW!), check out Spaces: https://huggingface.co/spaces
RetryError[<Future at 0x7fb1a0319f90 state=finished raised TypeError>]

CUDA SETUP: WARNING! libcuda.so not found!

/home/zsd/.local/lib/python3.10/site-packages/bitsandbytes/cuda_setup/main.py:136: UserWarning: WARNING: The following directories listed in your path were found to be non-existent: {PosixPath('qychen/luotuo-lora-7b-0.1')} warn(msg) /home/zsd/.local/lib/python3.10/site-packages/bitsandbytes/cuda_setup/main.py:136: UserWarning: WARNING: The following directories listed in your path were found to be non-existent: {PosixPath('unix')} warn(msg) CUDA_SETUP: WARNING! libcudart.so not found in any environmental path. Searching /usr/local/cuda/lib64... CUDA SETUP: WARNING! libcuda.so not found! Do you have a CUDA driver installed? If you are on a cluster, make sure you are on a CUDA machine! CUDA SETUP: CUDA runtime path found: /usr/local/cuda/lib64/libcudart.so /home/zsd/.local/lib/python3.10/site-packages/bitsandbytes/cuda_setup/main.py:136: UserWarning: WARNING: No GPU detected! Check your CUDA paths. Proceeding to load CPU-only library... warn(msg) CUDA SETUP: Loading binary /home/zsd/.local/lib/python3.10/site-packages/bitsandbytes/libbitsandbytes_cpu.so... /home/zsd/.local/lib/python3.10/site-packages/bitsandbytes/cextension.py:31: UserWarning: The installed version of bitsandbytes was compiled without GPU support. 8-bit optimizers and GPU quantization are unavailable.... from model import load_model File "/home/zsd/Chinese-alpaca-lora/notebook/Alpaca-LoRA-Serve/model.py", line 2, in <module> from transformers import LlamaTokenizer, LlamaForCausalLM ImportError: cannot import name 'LlamaTokenizer' from 'transformers' (/home/zsd/anaconda3/lib/python3.10/site-packages/transformers/__init__.py)

有没有尝试过GLM做基座

LLaMA在中文上表现挺一般的,基于LLaMA的微调项目,我感觉中文能力都很差,根本比不上glm-6b。基于glm6b去微调,中文表现可能会更好一些

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.