世界最强开源大模型 falcon 180b 忽然火爆全网,1800亿参数,falcon 在 3.5 万亿 token 完成训练,性能碾压 llama 2,登顶 hugging face 排行榜。
今年 5 月,tii(阿联酋阿布扎比技术创新研究所)推出了号称是 “史上最强的开源大语言模型”——falcon(猎鹰)。虽然 falcon 的参数比 llama 小,但性能却更加强大。
此前,falcon 已经推出了三种模型大小,分别是1.3b、7.5b、40b。据介绍,falcon 180b 是 40b 的升级版本, falcon 180b 的规模是 llama 2 的 2.5 倍,且可免费商用。 falcon 180b 在 hugging face 开源大模型榜单上被认为是当前评分最高的开放式大模型,其评分68.74,meta 的 llama 2 以 1.39 的分数差距排名第二 。
据官方介绍,falcon 180b 是当前最好的开源大模型。 其在 mmlu 上 的表现超过了 llama 2 70b 和 openai 的 gpt-3.5。在 hellaswag、lambada、webquestions、winogrande、piqa、arc、boolq、cb、copa、rte、wic、wsc 及 record 上与谷歌的 palm 2-large 不相上下。
目前大家可以通过以下地址进行demo 体验:https://hf.co/spaces/huggingfaceh4/falcon-chat
硬件要求
类型 种类 最低要求 配置示例
falcon 180b training full fine-tuning 5120gb 8x 8x a100 80gb
falcon 180b training lora with zero-3 1280gb 2x 8x a100 80gb
falcon 180b training qlora 160gb 2x a100 80gb
falcon 180b inference bf16/fp16 640gb 8x a100 80gb
falcon 180b inference gptq/int4 320gb 8x a100 40gb
prompt 格式
其基础模型没有 prompt 格式,因为它并不是一个对话型大模型也不是通过指令进行的训练,所以它并不会以对话形式回应。预训练模型是微调的绝佳平台,但或许你不该直接使用。其对话模型则设有一个简单的对话模式。
system: add an optional system prompt hereuser: this is the user inputfalcon: this is what the model generatesuser: this might be a second turn inputfalcon: and so on
transformers
从 transfomers 4.33 开始,可以在 hugging face 上使用 falcon 180b 并且使用 hf 生态里的所有工具。但是前提是请确保你已经登录了自己的 hugging face 账号,并安装了最新版本的 transformers:
pip install --upgrade transformershuggingface-cli loginbfloat16 以下是如何在 bfloat16 中使用基础模型的方法。falcon 180b 是一个大型模型,所以请注意它的硬件要求(硬件要求如上所示)。from transformers import autotokenizer, automodelforcausallmimport transformersimport torchmodel_id = tiiuae/falcon-180btokenizer = autotokenizer.from_pretrained(model_id)model = automodelforcausallm.from_pretrained( model_id, torch_dtype=torch.bfloat16, device_map=auto,)prompt = my name is pedro, i live ininputs = tokenizer(prompt, return_tensors=pt).to(cuda)output = model.generate( input_ids=inputs[input_ids], attention_mask=inputs[attention_mask], do_sample=true, temperature=0.6, top_p=0.9, max_new_tokens=50,)output = output[0].to(cpu)print(tokenizer.decode(output)
这可能会产生如下输出结果:
my name is pedro, i live in portugal and i am 25 years old. i am a graphic designer, but i am also passionate about photography and video.i love to travel and i am always looking for new adventures. i love to meet new people and explore new places.使用 8 位和 4 位的 bitsandbytes falcon 180b 的 8 位和 4 位量化版本在评估方面与 bfloat16 几乎没有差别!这对推理来说是个好消息,因为你可以放心地使用量化版本来降低硬件要求。请记住,在 8 位版本进行推理要比 4 位版本快得多。要使用量化,你需要安装 “bitsandbytes” 库,并在加载模型时启用相应的标志:model = automodelforcausallm.from_pretrained( model_id, torch_dtype=torch.bfloat16, **load_in_8bit=true,** device_map=auto,)对话模型 如上所述,为跟踪对话而微调的模型版本使用了非常直接的训练模板。我们必须遵循同样的模式才能运行聊天式推理。作为参考,你可以看看聊天演示中的 format_prompt 函数:def format_prompt(message, history, system_prompt): prompt = if system_prompt: prompt += fsystem: {system_prompt} for user_prompt, bot_response in history: prompt += fuser: {user_prompt} prompt += ffalcon: {bot_response} prompt += fuser: {message}falcon: return prompt如你所见,用户的交互和模型的回应前面都有 user: 和 falcon: 分隔符。我们将它们连接在一起,形成一个包含整个对话历史的提示。这样就可以提供一个系统提示来调整生成风格。
工业和信息化部召开第二次中小企业圆桌会议
通过CPLD的编码器解码接口、PWM输出设计
为什么处理器这么耗电,该如何解决
如何从TI新的全集成变压器技术中获益
低温循环水槽(高精度)的产品特点是什么
开源大模型Falcon(猎鹰) 180B发布 1800亿参数
python字符串拼接方式了解
中小企业请收藏丨轻量应用服务器企业选购避坑指南
贾跃亭 FF 将通过 SPAC 合并上市,FF 91 或一年后上市
好奇心对于学习人工智能有帮助吗
喜讯!捷易科技喜获ISO27001信息安全管理体系认证
Apollo定义生态 开发者定义未来
PebbleTime评测 GameBoy一样的情怀屏幕
中国高端医疗器械依赖进口,广东已逐渐形成医疗器械产业集群
苹果AR/VR头显相关专利:利用光学标记定位目标物体
美国政府发布中国通讯产品封杀令 商务部认为这是一种错误信号
单片机的两大系列进行PK_MSP430和AVR
泄洪预警水库水电站泄洪预警解决方案
如何选择好的LED显示屏模组套件
OPPOR11推出王者荣耀定制版即将上市